Closed ballastcanary closed 1 year ago
You don't need to specify math.
, so just do as follows:
roundoff = round(3.22,1)
Note that this is actually rounding the number not just changing the rendered output, so roundoff
will now contain 3.2
.
If you are looking for the ability to specify the output number format (including how many decimals) on a per-line (or whole vault) basis, perhaps you could open a new feature request for that with some example use cases.
Closing as fixed, but please re-open if I haven't addressed your issue
This input: produces this output:
in Numeral beta 1.09.
So from my point there are issues with the underlying mathjs (round(100*pi,-1) should give 310 from my point of view) and with the rendering in math-tex, but if yiu ommit the 'math.' it should work.
Can this be used with a variable?
salary_annual = $150000
salary_weekly = salary_annual / 52
round(salary_weekly,1)
Doesn't work for me.
It defaults to 3 decimals. I've tried using the math.round(x,n) function from mathjs but it gives an error. Eg. roundoff = math.round(3.22,1) will not calculate.