[Solved] How to handle consequence of zero’s in java script [closed]


the easiest way to parse a string to number is Number constructor (not only integer)

Number("0000.14"); // 0.14
Number("000000") // 0

or you can add plus sign before a strings

+"00000" // 0
+"000.12" // 0.12

1

solved How to handle consequence of zero’s in java script [closed]