Fixed bug causing digit drop rather than rounding

This commit is contained in:
2020-07-11 13:55:01 -04:00
parent d3a71af6dd
commit 403cef9170

View File

@@ -123,8 +123,8 @@ public class Stopwatch{
}
//Turn the number into a string
Double durationFraction = ((duration % 1) * 1000);
String time = String.format("%d.%03d", duration.intValue(), durationFraction.intValue());
int durationFraction = (int)Math.round(((duration % 1) * 1000));
String time = String.format("%d.%03d", duration.intValue(), durationFraction);
//Tack on the appropriate suffix for resolution
switch(resolution){