<!DOCTYPE html> <html> <body> <h1>JavaScript Global Methods</h1> <h2>The parseFloat() Method</h2> <p>parseFloat() parses a string and returns the first number:</p> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = new Number(parseFloat(" 0.00 ")).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) </script> </body> </html>