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

Reindent changes -1e-10 to be a string #14

Open
chrisranderson opened this issue Aug 30, 2018 · 1 comment
Open

Reindent changes -1e-10 to be a string #14

chrisranderson opened this issue Aug 30, 2018 · 1 comment

Comments

@chrisranderson
Copy link

Given the file contents:

{"a": -1e-10}

Reindenting returns:

{
  "a": "-1e-10"
}

It should leave it as a number in scientific notation:

{
  "a": -1e-10
}
@willstott101
Copy link

Looks like this is due to using pyyaml to load json...

>>> json.loads("-1e-10")
-1e-10
>>> yaml.safe_load("-1e-10")
'-1e-10'

Here is the bug report in PyYAML: yaml/pyyaml#173

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