0

If you put this in the browser address bar (firefox/IE8):

javascript:alert(40.34+56.87)

Why the result comes as 97.2100000000001
when its supposed to be 97.21

JavaSheriff
  • 7,074
  • 20
  • 89
  • 159

1 Answers1

-2
javascript:alert((40.34+56.87).toFixed(2))
gustavohenke
  • 40,997
  • 14
  • 121
  • 129