Glossary Term
parseFloat()
The parseFloat() function parses a string argument and returns a floating point number.
The parseFloat function converts its first argument to a string, parses that string as a decimal number literal, then returns a number or NaN. The number syntax it accepts can be summarized as:
The characters accepted by parseFloat() are plus sign (+), minus sign (- U+002D HYPHEN-MINUS), decimal digits (0 – 9), decimal point (.), exponent indicator (e or E), and the “Infinity” literal. The +/- signs can only appear strictly at the beginning of the string, or immediately following the e/E character. The decimal point can only appear once, and only before the e/E character. The e/E character can only appear once, and only if there is at least one digit before it. Leading spaces in the argument are trimmed and ignored. parseFloat() can also parse and return Infinity or -Infinity if the string starts with “Infinity” or “-Infinity” preceded by none or more white spaces. parseFloat() picks the longest substring starting from the beginning that generates a valid number literal.
Syntax example: parseFloat(string)
Term Connections
Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.
Loading term connections…
