mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
add a trailing zero to $float
This commit is contained in:
@@ -254,6 +254,8 @@ proc nimFloatToStr(x: float): string {.compilerproc.} =
|
|||||||
var buf: array [0..59, char]
|
var buf: array [0..59, char]
|
||||||
c_sprintf(buf, "%#.f", x)
|
c_sprintf(buf, "%#.f", x)
|
||||||
result = $buf
|
result = $buf
|
||||||
|
if result[len(result)-1] == '.':
|
||||||
|
result.add("0")
|
||||||
|
|
||||||
proc nimInt64ToStr(x: int64): string {.compilerRtl.} =
|
proc nimInt64ToStr(x: int64): string {.compilerRtl.} =
|
||||||
result = newString(sizeof(x)*4)
|
result = newString(sizeof(x)*4)
|
||||||
|
|||||||
Reference in New Issue
Block a user