Skip to content

Commit 4b09baa

Browse files
committed
use .f instead of .16e for floats
It doesn't write a trailing zero, but it's better than floats being all over your screen.
1 parent a158053 commit 4b09baa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/system/sysstr.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ proc nimIntToStr(x: int): string {.compilerRtl.} =
252252

253253
proc nimFloatToStr(x: float): string {.compilerproc.} =
254254
var buf: array [0..59, char]
255-
c_sprintf(buf, "%#.16e", x)
256-
return $buf
255+
c_sprintf(buf, "%#.f", x)
256+
result = $buf
257257

258258
proc nimInt64ToStr(x: int64): string {.compilerRtl.} =
259259
result = newString(sizeof(x)*4)

0 commit comments

Comments
 (0)