add rounder to infocalc

This commit is contained in:
Bella 2020-01-28 14:04:11 -05:00
parent ca99df0e3d
commit 86d8917613
1 changed files with 7 additions and 0 deletions

View File

@ -97,4 +97,11 @@ public class InfoCalculator extends Module {
return formatter.format(date);
}
/* End of time */
/* Round */
public static double round(double value, int places) {
double scale = Math.pow(10, places);
return Math.round(value * scale) / scale;
}
/* End of round */
}