printing float values will have one more digit. (#13276) [backport]

* printing float values will have one more digit. Fixes #13196
This commit is contained in:
Arne Döring 2020-02-07 17:10:25 +01:00 • committed by GitHub
commit b2c6db97f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 45 additions and 41 deletions

View file

@ -677,7 +677,7 @@ proc pretty*(node: JsonNode, indent = 2): string =
## Similar to prettyprint in Python.
runnableExamples:
let j = %* {"name": "Isaac", "books": ["Robot Dreams"],
"details": {"age": 35, "pi": 3.1415}}
"details": {"age": 35, "number": 3.125}}
doAssert pretty(j) == """
{
"name": "Isaac",
@ -686,7 +686,7 @@ proc pretty*(node: JsonNode, indent = 2): string =
],
"details": {
"age": 35,
"pi": 3.1415
"number": 3.125
}
}"""
result = ""