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

Large numbers serialized incorrectly #41

Open
winseros opened this issue Nov 10, 2022 · 3 comments · May be fixed by #46
Open

Large numbers serialized incorrectly #41

winseros opened this issue Nov 10, 2022 · 3 comments · May be fixed by #46

Comments

@winseros
Copy link

I have a lua object containing a large number:

local obj = {prop=1925036013156063406}

When the object is serialized, the JSON looks like:

{"prop":1.9250360131561e+18}

and can not be parsed by other JSON libraries on other programming languages.

The correct serializaion output would be:

{"prop":1925036013156063406}

aleksanderd added a commit to aleksanderd/json.lua that referenced this issue Nov 11, 2022
@aleksanderd
Copy link

@winseros try this aleksanderd@15823a4

@winseros
Copy link
Author

@aleksanderd it works fine. I'll use it for now. Thank you!

alexandro-rezakhani added a commit to alexandro-rezakhani/json.lua that referenced this issue Nov 20, 2022
alexandro-rezakhani added a commit to alexandro-rezakhani/json.lua that referenced this issue Nov 20, 2022
fix rxi#41: Large numbers serialized incorrectly
@Vurv78
Copy link

Vurv78 commented Jun 29, 2023

Indeed it could be serialized differently, however that is valid JSON. Whatever other library you are parsing it from does not follow the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants