Closed pandatix closed 7 months ago
I would suggest using Math.round(value*10)/10
rather than the multiplication, toFixed
. The toFixed
solution goes Number *10 -> String -> Number/10. Whereas the Math.round
will just be Number -> Number. For our numbers (0 to 10), they should, be the same.
Looks good to me!
This PR fixes the rounding issue observed by #48.
It makes sure to round on integers rather than decimals thus avoids
0.1 + 0.2 ! =0.3
issues.