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

Error with large integers #13

Open
fabioglopes opened this issue Jul 16, 2021 · 1 comment
Open

Error with large integers #13

fabioglopes opened this issue Jul 16, 2021 · 1 comment

Comments

@fabioglopes
Copy link

I've been facing an issue when I try to process a json file with large integers, it changes the value of last 2 digits.
I'm trying to convert the json to jsonl using this command: jstream -d 1 < #{directory}#{json_file_name} > #{directory}#{json_file_name}l
An integer Id like this "campaignId":144126219108390099 is converted to this: "campaignId":144126219108390080
Just wondering if this is an integer size limitation like Jq jqlang/jq#369

Thanks!!

@pkoppstein
Copy link

@fabioglopes - For the record, jm (based on "JSON Machines") preserves numerical accuracy. E.g.

jm  <<< '{"campaignId":144126219108390099, "float": 1.20000000000000000000000000005 }'
144126219108390099
1.20000000000000000000000000005

Likewise, the "development" (i.e. master) version of jq has for some time now included enhancements that preserve the precision of numbers, at least until some arithmetic operation is performed on them.

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

No branches or pull requests

2 participants