diff --git a/lib/system/formatfloat.nim b/lib/system/formatfloat.nim index cb46c8c361391..abacca4dfcde0 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, "%.16g", value) + var n: int = c_sprintf(addr buf, "%.17g", value) var hasDot = false for i in 0..n-1: if buf[i] == ',':