mirror of https://github.com/status-im/NimYAML.git
Fixed issue: integer numbers could not be parsed as float
This commit is contained in:
parent
dcdb04b79d
commit
e33af48217
|
@ -142,6 +142,8 @@ proc constructObject*[T: float|float32|float64](
|
||||||
case hint
|
case hint
|
||||||
of yTypeFloat:
|
of yTypeFloat:
|
||||||
discard parseBiggestFloat(item.scalarContent, result)
|
discard parseBiggestFloat(item.scalarContent, result)
|
||||||
|
of yTypeInteger:
|
||||||
|
discard parseBiggestFloat(item.scalarContent, result)
|
||||||
of yTypeFloatInf:
|
of yTypeFloatInf:
|
||||||
if item.scalarContent[0] == '-': result = NegInf
|
if item.scalarContent[0] == '-': result = NegInf
|
||||||
else: result = Inf
|
else: result = Inf
|
||||||
|
|
Loading…
Reference in New Issue