Open starburst997 opened 5 years ago
Leaving that here but on line 651 of DecimalFormat it will brake in some circumstances:
DecimalFormat
p[0] = p[0].substring(0, p[0].length-1) + (Std.parseFloat(p[0].substring(p[0].length-1)) + 1);
If you have a number like 89.99999999998, it becomes 810 (89 become '8', and 9 + 1 become 10, '8' + 10 = '810')
89.99999999998
810
I guess, why not simply use Math.round(decimal); ? Is it because by using string manipulation it can handle numbers that goes above Float?
Math.round(decimal);
Leaving that here but on line 651 of
DecimalFormat
it will brake in some circumstances:If you have a number like
89.99999999998
, it becomes810
(89 become '8', and 9 + 1 become 10, '8' + 10 = '810')