Skip to content

Commit 33fcd11

Browse files
committed
add a trailing zero to $float
1 parent 4b09baa commit 33fcd11

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/system/sysstr.nim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ proc nimFloatToStr(x: float): string {.compilerproc.} =
254254
var buf: array [0..59, char]
255255
c_sprintf(buf, "%#.f", x)
256256
result = $buf
257+
if result[len(result)-1] == '.':
258+
result.add("0")
257259

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

0 commit comments

Comments
 (0)