mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
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.
This commit is contained in:
@@ -252,8 +252,8 @@ proc nimIntToStr(x: int): string {.compilerRtl.} =
|
||||
|
||||
proc nimFloatToStr(x: float): string {.compilerproc.} =
|
||||
var buf: array [0..59, char]
|
||||
c_sprintf(buf, "%#.16e", x)
|
||||
return $buf
|
||||
c_sprintf(buf, "%#.f", x)
|
||||
result = $buf
|
||||
|
||||
proc nimInt64ToStr(x: int64): string {.compilerRtl.} =
|
||||
result = newString(sizeof(x)*4)
|
||||
|
||||
Reference in New Issue
Block a user