I have tried to use with-precision
but it didn't work:
(.log js/console (with-precision 2 1.2345))
So I have used toFixed
:
(.log js/console (.toFixed 1.2345 2))
But I feel it's not the idiomatic way of doing that.
In addition, I don't understand why with-precision
doesn't work.
Please inspire me...