
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
What is the role of parseFloat() method in JavaScript?
Use the parseFloat() method in JavaScript to return a floating point number after parsing a string.
Example
You can try to run the following code to learn how to work with parseFloat() method in JavaScript.
<!DOCTYPE html> <html> <body> <script> var val1 = parseFloat("2"); var val2 = parseFloat("30 minutes"); document.write(val1); document.write("<br>"+val2); </script> </body> </html>
- Related Articles
- What is the role of filter() method in JavaScript?
- What is the role of parseInt() method in JavaScript?
- What is the role of exec method in JavaScript RegExp?
- parseFloat() function in JavaScript
- What is the role of clearTimeout() function in JavaScript?
- What is the role of throw statement in JavaScript?
- What is the role of Navigator object in JavaScript?
- What is the role of pageXOffset property in JavaScript?
- What is the role of scrollY property in JavaScript?
- What is the role of scrollX property in JavaScript?
- What is the role of deferred scripts in JavaScript?
- What is the role of the String intern() method in java?
- What is the role of the window.history object in JavaScript?
- What is the role of global RegExp property in JavaScript?
- What is the role of source RegExp property in JavaScript?

Advertisements