Fixed error when number isn't long enough

This commit is contained in:
Fuzzlemann 2017-07-27 20:31:39 +02:00
parent 747592d688
commit 3112b24e17

View File

@ -180,7 +180,10 @@ public class MathUtils {
*/
public static double round(double number) {
String formattedNumber = decimalFormat.format(number);
formattedNumber = formattedNumber.substring(0, 3); //Fix for unknown reasons for not-rounding
if (formattedNumber.length() > 4) {
formattedNumber = formattedNumber.substring(0, 3); //Fix for unknown reasons for not-rounding
}
return Double.valueOf(formattedNumber);
}
}