Removed deprecated math.round call.
h3rald h3rald@h3rald.com
Fri, 10 Jan 2020 20:14:43 +0100
1 files changed,
6 insertions(+),
2 deletions(-)
jump to
M
lib/min_math.nim
→
lib/min_math.nim
@@ -1,5 +1,7 @@
import - math + math, + strformat, + strutils import ../core/parser, ../core/value,@@ -28,7 +30,9 @@ def.symbol("round") do (i: In):
let vals = i.expect("int", "num") let places = vals[0].intVal.int let n = vals[1].getFloat - i.push n.round(places).newVal + var res = "" + formatValue(res, n, "." & $places & "f") + i.push parseFloat(res).newVal def.symbol("e") do (i: In): i.push E.newVal