CubeStuffs / CubeTime

Simple, modern speedcubing timer with many utilities, built with SwiftUI & UIKit.
https://cubetime.app
GNU General Public License v3.0
90 stars 5 forks source link

Truncate vs round #177

Closed SuperPro148 closed 5 months ago

SuperPro148 commented 11 months ago

Hey, I noticed that the time updater rounds rather than truncates when it has less decimals than the actual time. I use 2 decimals for time and 1 decimal while timing but for example when the time is 18.77 when I stop the timer, it shows 18.8 shortly before pressing. I suspect this is due to rounding the time rather than truncating it.

pdtxie commented 11 months ago

That’s an interesting observation, I haven’t noticed it myself. Will look into this issue.

pdtxie commented 11 months ago

Ok I can reproduce. Seems that the time needs to be truncated first, then have it formatted in the string. Format specifiers round by default!

xbjfk commented 5 months ago

Fixed (see also #187)