incorrect output with '#,##0.00' format
jinjin9527 opened this issue · 0 comments
jinjin9527 commented
SSF.format( "#,##0.00", 3.105 ) gives a result of '3.10' - it should be '3.11'.
It seems there is a bug in dec function.
Current version:
・get decimal part:
3.105 -> 0.104999998
・power the decimal part
Math.pow(0.1049998, 2) -> 10.49998
・round off powered decimal part
Math.floor(10.49998) -> 10
Shloud The logic be as below.
Math.pow(3.105,2) -> 310.5 -> Math.floor(310.5) -> 311 -> 311/100 -> 3.11