JS: Number.parseFloat (String to Number)
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