0

While reading the post Round to at most 2 decimal places (only if necessary), I found an interesting thing but I haven't figured out the reason.

1.005 * 100 // 100.49999999999999 (In Chrome 47.0)
1.005 * 100 // 100.49999999999999 (In Firefox 38.6)
1.005 * 100 // 100.49999999999998 (In MSIE 11)
2.005 * 100 // 200.5 (In all browsers)

What is the rounding issue of JS interpreter with the magical 1.005?

Community
  • 1
  • 1
stanleyxu2005
  • 8,081
  • 14
  • 59
  • 94

0 Answers0