3

Hopefully someone can help as this is driving me nuts. I'm using alert as an example to abstract from my code.

alert(10153507376200685); //returns 10153507376200684
alert(10153507376200684); //returns 10153507376200684
alert(10153507376200687); //returns 10153507376200688

What is wrong with the odd number ending/.

  • [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) – robertklep Jun 17 '16 at 13:06
  • 1
    Possible duplicate of [What is JavaScript's highest integer value that a Number can go to without losing precision?](http://stackoverflow.com/questions/307179/what-is-javascripts-highest-integer-value-that-a-number-can-go-to-without-losin) – vaso123 Jun 17 '16 at 13:06
  • Is it possible to output that value as a string? E.g. alert('10153507376200685'); – Ashwin Balamohan Jun 17 '16 at 13:31

0 Answers0