fixes #1192
This commit is contained in:
parent
809a4a77a5
commit
437f464810
1 changed files with 7 additions and 0 deletions
|
|
@ -419,6 +419,9 @@ proc formatValue*(result: var string; value: SomeInteger; specifier: string) =
|
||||||
## Standard format implementation for ``SomeInteger``. It makes little
|
## Standard format implementation for ``SomeInteger``. It makes little
|
||||||
## sense to call this directly, but it is required to exist
|
## sense to call this directly, but it is required to exist
|
||||||
## by the ``&`` macro.
|
## by the ``&`` macro.
|
||||||
|
if specifier.len == 0:
|
||||||
|
result.add $value
|
||||||
|
return
|
||||||
let spec = parseStandardFormatSpecifier(specifier)
|
let spec = parseStandardFormatSpecifier(specifier)
|
||||||
var radix = 10
|
var radix = 10
|
||||||
case spec.typ
|
case spec.typ
|
||||||
|
|
@ -719,6 +722,10 @@ when isMainModule:
|
||||||
let flfoo: float = 1.0
|
let flfoo: float = 1.0
|
||||||
check &"{flfoo}", "1.0"
|
check &"{flfoo}", "1.0"
|
||||||
|
|
||||||
|
# bug #11092
|
||||||
|
check &"{high(int64)}", "9223372036854775807"
|
||||||
|
check &"{low(int64)}", "-9223372036854775808"
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
doAssert fmt"{'a'} {'b'}" == "a b"
|
doAssert fmt"{'a'} {'b'}" == "a b"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue