mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-05 06:51:45 +01:00
Fixed error when number isn't long enough
This commit is contained in:
parent
747592d688
commit
3112b24e17
@ -180,7 +180,10 @@ public class MathUtils {
|
|||||||
*/
|
*/
|
||||||
public static double round(double number) {
|
public static double round(double number) {
|
||||||
String formattedNumber = decimalFormat.format(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);
|
return Double.valueOf(formattedNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user