summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/json.nim4
-rw-r--r--lib/system/formatfloat.nim2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/json.nim b/lib/pure/json.nim
index 6ec0d1616..319a7b7ff 100644
--- a/lib/pure/json.nim
+++ b/lib/pure/json.nim
@@ -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, "number": 3.125}}
+                "details": {"age": 35, "pi": 3.1415}}
     doAssert pretty(j) == """
 {
   "name": "Isaac",
@@ -686,7 +686,7 @@ proc pretty*(node: JsonNode, indent = 2): string =
   ],
   "details": {
     "age": 35,
-    "number": 3.125
+    "pi": 3.1415
   }
 }"""
   result = ""
diff --git a/lib/system/formatfloat.nim b/lib/system/formatfloat.nim
index abacca4df..cb46c8c36 100644
--- a/lib/system/formatfloat.nim
+++ b/lib/system/formatfloat.nim
@@ -29,7 +29,7 @@ proc writeFloatToBuffer*(buf: var array[65, char]; value: BiggestFloat): int =
   ## * `buf` - A buffer to write into. The buffer does not need to be
   ##           initialized and it will be overridden.
   ##
-  var n: int = c_sprintf(addr buf, "%.17g", value)
+  var n: int = c_sprintf(addr buf, "%.16g", value)
   var hasDot = false
   for i in 0..n-1:
     if buf[i] == ',':