Fixed bug causing digit drop rather than rounding
This commit is contained in:
@@ -123,8 +123,8 @@ public class Stopwatch{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Turn the number into a string
|
//Turn the number into a string
|
||||||
Double durationFraction = ((duration % 1) * 1000);
|
int durationFraction = (int)Math.round(((duration % 1) * 1000));
|
||||||
String time = String.format("%d.%03d", duration.intValue(), durationFraction.intValue());
|
String time = String.format("%d.%03d", duration.intValue(), durationFraction);
|
||||||
|
|
||||||
//Tack on the appropriate suffix for resolution
|
//Tack on the appropriate suffix for resolution
|
||||||
switch(resolution){
|
switch(resolution){
|
||||||
|
|||||||
Reference in New Issue
Block a user