This question has already been answered:

There is a line, by type, 350.023px, from it I need to get the number 350.023, but if I use the parseInt () method, then only 350 is left. How can I get the number to be decimalized?

Reported as a duplicate at Grundy. javascript 24 Jul '17 at 9:43

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    1 answer 1

    Use .parseFloat () for this.

    var str = '350.023px'; console.log(parseFloat(str));