mirror of
https://bitbucket.org/Mattrixwv/javaclasses.git
synced 2025-12-06 15:03:58 -05:00
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
|
||||
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){
|
||||
|
||||
Reference in New Issue
Block a user