I have been using this for sometime now before I noticed that is not reliable
Math.floor(16.65*100) / 100 = 16.64
Why does this happen? Any reliable alternative for rounding down safely in JS?
I have been using this for sometime now before I noticed that is not reliable
Math.floor(16.65*100) / 100 = 16.64
Why does this happen? Any reliable alternative for rounding down safely in JS?
It's because 16.65 * 100
is calculated to 1664.9999999999998