mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 20:17:42 +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.} =
|
proc nimFloatToStr(x: float): string {.compilerproc.} =
|
||||||
var buf: array [0..59, char]
|
var buf: array [0..59, char]
|
||||||
c_sprintf(buf, "%#.16e", x)
|
c_sprintf(buf, "%#.f", x)
|
||||||
return $buf
|
result = $buf
|
||||||
|
|
||||||
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