I would like to return the number, 15.00
, in a json payload: {"theNumber" : 15.00}
. All my research on SO has suggested to do something like parseFloat(15).toFixed(2)
, but this always returns a string and therefore does not solve the problem of returning 15.00
as a number / float.
Is it possible to return a number in JS with two decimal values as zeros?