Fix rounding issues
This commit is contained in:
parent
5ac582261c
commit
fc46343454
|
|
@ -23,8 +23,7 @@ public class Utilities {
|
||||||
scale = (int) Math.pow(10, precision + 1);
|
scale = (int) Math.pow(10, precision + 1);
|
||||||
long tmp = (Math.round(num * scale));
|
long tmp = (Math.round(num * scale));
|
||||||
|
|
||||||
while (tmp > 10)
|
tmp %= 10;
|
||||||
tmp /= 10;
|
|
||||||
if (tmp > 4)
|
if (tmp > 4)
|
||||||
total += 0.01;
|
total += 0.01;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user