I\'ve got a currency input and need to return only significant digits. The input always has two decimal places, so:
4.00 -> 4 4.10 -> 4.1 4.01 ->
I think this is what you want
v = 33.404034 v.toFixed(2) # v -> 33.40 parseFloat(v.toFixed(2)) # 33.4
and you have
v = 33.00704034 v.toFixed(2) # v -> 33.01 parseFloat(v.toFixed(2)) # 33.01 v = 33.00304034 v.toFixed(2) # v -> 33.00 parseFloat(v.toFixed(2)) # 33