Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad output from TimeTool.millisecondsToTime(millis) #27

Open
HelgeStenstrom opened this issue Sep 3, 2019 · 0 comments
Open

Bad output from TimeTool.millisecondsToTime(millis) #27

HelgeStenstrom opened this issue Sep 3, 2019 · 0 comments

Comments

@HelgeStenstrom
Copy link
Collaborator

"1001, '.0' ", // Slightly over 1 second TODO: check if this is a bug,
"600001, '.0' " // Slightly over 10 minutes TODO: check if this is a bug

The method TimeTool.millisecondsToTime(millis) convert an integer, representing a number of milliseconds, to a string.

It's unclear from the JavaDoc of the method, what the intention was.

The JavaDoc has formatting problems; the /** before the word Returns should be removed.

The method contains commented-out code, which should be removed.

Given the name of the method, and the JavaDoc, I would expect a method that converts the milliseconds to hours:minutes:seconds (if time is over 60 minutes), or minutes:seconds otherwise.

This can be described as

    @CsvSource({
            "0, '00:00' ",
            "1, '00:00' ",
            "999, '00:01' ",
            "1001, '00:01' ",  // Slightly over 1 second
            "600001, '10:00 ", // Slightly over 10 minutes
            "3601001, '60:01 ", // One hour, one second (and a rounded off millisecond)
    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant