JS: Number.parseFloat (String to Number)

By Xah Lee. Date: . Last updated: .

parseFloat

Number.parseFloat(string)

Convert a string to a decimal number.

console.log(parseFloat("324") === 324)

console.log(parseFloat("1.24") === 1.24)

Global Object

Number.parseFloat is the same as the "parseFloat" of the Global Object.

Number.parseFloat === globalThis.parseFloat

JavaScript. Convert Decimal, Hexadecimal, Binary