Large numbers erroneously rounded in JavaScript

Viewed 42273

See this code:

var jsonString = '{"id":714341252076979033,"type":"FUZZY"}';
var jsonParsed = JSON.parse(jsonString);
console.log(jsonString, jsonParsed);

When I see my console in Firefox 3.5, the value of jsonParsed is the number rounded:

Object id=714341252076979100 type=FUZZY

Tried different values, the same outcome (number rounded).

I also don't get its rounding rules. 714341252076979136 is rounded to 714341252076979200, whereas 714341252076979135 is rounded to 714341252076979100.

Why is this happening?

6 Answers
Related