fixes #18134; registers formatBiggestFloat in vmops strformat supports float format in VM
This commit is contained in:
parent
23bd812b0c
commit
fc068ee06d
3 changed files with 73 additions and 61 deletions
|
|
@ -36,7 +36,9 @@ from std/osproc import nil
|
|||
when defined(nimPreviewSlimSystem):
|
||||
import std/syncio
|
||||
else:
|
||||
from std/formatfloat import addFloatRoundtrip, addFloatSprintf
|
||||
from std/formatfloat import addFloatRoundtrip, addFloatSprintf
|
||||
|
||||
from std/strutils import formatBiggestFloat, FloatFormatMode
|
||||
|
||||
# There are some useful procs in vmconv.
|
||||
import vmconv, vmmarshal
|
||||
|
|
@ -374,6 +376,10 @@ proc registerAdditionalOps*(c: PCtx) =
|
|||
let x = a.getFloat(1)
|
||||
addFloatSprintf(p.strVal, x)
|
||||
|
||||
registerCallback c, "stdlib.strutils.formatBiggestFloat", proc(a: VmArgs) =
|
||||
setResult(a, formatBiggestFloat(a.getFloat(0), FloatFormatMode(a.getInt(1)),
|
||||
a.getInt(2), chr(a.getInt(3))))
|
||||
|
||||
wrapIterator("stdlib.envvars.envPairsImplSeq"): envPairs()
|
||||
|
||||
registerCallback c, "stdlib.marshal.toVM", proc(a: VmArgs) =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue