You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 28, 2019. It is now read-only.
Hey,
I really don't know if I should treat this as a bug report or as a feature request.
Since we're hitting Javascripts limits I think it's a feature request.
When getting response from an API with, let's say this string: '{"x":9223372036854775807}' the JSON.parsed object o is o.x == 9223372036854776000.
There are two options here (that I can think of)
convert the number to a string before parsing
use some kind of bignum or equivalent library to help with the representation
I would prefer to have the number as a string if the limit is hit.
What's your take on this?
PS. Here's a test.
testSuite.addTest("`parse`: Handle big Numbers", function (t) {
var refString = '{"x":9223372036854775807}';
var stringifiedObj = JSON.stringify(JSON.parse(refString));
this.equal(refString, stringifiedObj, 'Compare strings before and after.');
this.done(1);
});
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey,
I really don't know if I should treat this as a bug report or as a feature request.
Since we're hitting Javascripts limits I think it's a feature request.
When getting response from an API with, let's say this string:
'{"x":9223372036854775807}'
the JSON.parsed object o iso.x == 9223372036854776000
.There are two options here (that I can think of)
I would prefer to have the number as a string if the limit is hit.
What's your take on this?
PS. Here's a test.
The text was updated successfully, but these errors were encountered: