Convert string to float
suggest changeparseFloat accepts a string and parses a leading floating-point number. It stops at the first character that cannot be part of that number, and returns NaN when the string does not start with a number.
parseFloat("10.01") // 10.01
parseFloat("10.5abc") // 10.5
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents