|
|
|
|
|
by magicalhippo
1997 days ago
|
|
> However, this would result in 59.51s being displayed as 0:60, though it should be 1:00. Rounding up has the same problem. Surely one shouldn't round _after_ splitting the time into minutes and seconds. You floor() or ceil() the time, depending on if you're counting up or down, to the lowest unit your timer is showing, then you display it and in the process split it into hours, minutes etc. So ceil(59.51s) = 60s, which is then converted to 0h 1m 0s for display. |
|