More human readable $(float)
The output matches that of Python (eg 1e100, not 1.0e100), but also reflects locale (assuming it was set using setlocale() before).
This commit is contained in:
parent
d927eb5854
commit
cea2a9087d
3 changed files with 16 additions and 7 deletions
|
|
@ -17,12 +17,12 @@ proc reprFloat(x: float): string {.compilerproc.} = return $x
|
|||
|
||||
proc reprPointer(x: pointer): string {.compilerproc.} =
|
||||
var buf: array [0..59, char]
|
||||
c_sprintf(buf, "%p", x)
|
||||
discard c_sprintf(buf, "%p", x)
|
||||
return $buf
|
||||
|
||||
proc `$`(x: uint64): string =
|
||||
var buf: array [0..59, char]
|
||||
c_sprintf(buf, "%llu", x)
|
||||
discard c_sprintf(buf, "%llu", x)
|
||||
return $buf
|
||||
|
||||
proc reprStrAux(result: var string, s: string) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue