I have two numbers: 02.95
and 03.28
I would like to remove the extra 0 from front.
My Expected output: 2.95
and 3.28
How can I achieve this in Javascript?
I have two numbers: 02.95
and 03.28
I would like to remove the extra 0 from front.
My Expected output: 2.95
and 3.28
How can I achieve this in Javascript?
If they are individual strings themselves, the fastest and shortest way would be to convert them to numeric values with the Unary Plus (+
) prefix:
+"02.95" -> 2.95
+"03.28" -> 3.28