Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert integer value exceeding the maximum numeric value in JavaScript to string #252

Open
iRonin opened this issue Jul 14, 2015 · 2 comments

Comments

@iRonin
Copy link

iRonin commented Jul 14, 2015

We have an issue with integer values served by our Rails API and consumed by EmberJS app. They are stored in the DB as bigint and they exceed the maximum numeric value in JavaScript.
Isn't it something that should be handled by this gem?

@flori
Copy link
Member

flori commented Jul 14, 2015

I don't think the concept of a maximum numeric value exists in JSON itself. It would be possible to check against some settable limit in the gem, but then do what? Shouldn't javascript promote too large integers to floats anyway?

@sproot
Copy link

sproot commented Aug 12, 2015

I have exact same problem. I've tried to solve it by overriding Bignum#to_json method with no luck #254 . The idea was to convert large integers (53+ bits) to string.

@nobu nobu changed the title Conver integer value exceeding the maximum numeric value in JavaScript to string Convert integer value exceeding the maximum numeric value in JavaScript to string Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants