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

Numbers became corrupted on conversion #2201

Closed
klirichek opened this issue Oct 28, 2020 · 3 comments
Closed

Numbers became corrupted on conversion #2201

klirichek opened this issue Oct 28, 2020 · 3 comments

Comments

@klirichek
Copy link

When using jq as pretty-formatter it corrupt some numbers.
Reproduction is quite simple and works both in desktop and 'try online' version.

$ jq --version
jq-1.6
$ cat ex.json
{
  "numbers": [
    623237308590442816,
    2696721519739033356,
    15902905282948881040
  ]
}
$ cat ex.json | jq .
{
  "numbers": [
    623237308590442800,
    2696721519739033600,
    15902905282948880000
  ]
}

Expected behavior, obviously, is to leave numbers unchanged.

@itchyny
Copy link
Contributor

itchyny commented Oct 28, 2020

This is a frequently asked question (#545 #1652 #1959 #2109 #2131 #2182) and is already fixed in the master HEAD (implemented by #1752 in Oct, 2019).

 % jq --version
jq-master-a17dd32
 % cat ex.json
{
  "numbers": [
    623237308590442816,
    2696721519739033356,
    15902905282948881040
  ]
}
 % cat ex.json | jq .
{
  "numbers": [
    623237308590442816,
    2696721519739033356,
    15902905282948881040
  ]
}

@klirichek
Copy link
Author

@itchyny ok, that is not immediately clear which keywords use to find similar issues and whether they already fixed or not.
(btw, since even 'try online' is still affected - it is hard to realize whether it is already fixed or not. I personally will wait fix in homebrew).
Thanks for answer ).

@itchyny
Copy link
Contributor

itchyny commented Oct 28, 2020

Speaking of Homebrew, you can install the HEAD version with brew install --HEAD jq.

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