Parse json in javascript – long numbers get rounded

As others have stated, this is because the number is too big. However, you can work around this limitation by sending the number as a string like so:

var s="{"x":"6855337641038665531"}";

Then instead of using JSON.parse(), you can use a library such as javascript-bignum to work with the number.

Leave a Comment