Skip to content

Commit

Permalink
printing float values will have one more digit. Fixes nim-lang#13196
Browse files Browse the repository at this point in the history
  • Loading branch information
krux02 committed Jan 28, 2020
1 parent c841865 commit 6bfda4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/system/formatfloat.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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] == ',':
Expand Down

0 comments on commit 6bfda4e

Please sign in to comment.