ES6 - Number.parseFloat()


Advertisements


This method parses a string argument and returns a float representation of the passed string.

Syntax

Number.parseFloat(string)

Parameter Details

  • string − value to parse

Return Value

A float representation of the string.

Example

console.log(Number.parseFloat("10")); 
console.log(Number.parseFloat("10.23"));

Output

10 
10.23

es6_number.htm

Advertisements