In my MongoDB/Node backend I am doing some totaling of dollar amounts and returning that data to the front end. Note this is for displaying totals only, we're not altering the values themselves. Because we want two decimal places for the totaled dollar values, I am doing this:
let roundedTotalOpenBalance = math.round(totalOpenBalance, 2);
That will give me something like -- 322.45
-- which is what I want.
However, if the value total is 322
, I'd like to also pass that to the front end as 322.00
. How can I do this with math js? Or do I need to handle the transformation myself?