1. Home
  2. Computing & Technology
  3. JavaScript

ParseFloat

By , About.com Guide

Definition: The parseFloat built-in function extracts the number portion of whatever value is passed to it. One common use for this function is to convert numbers in text strings to numbers so that they can be used in numerical calculations. This is not a reserved word so you can declare your own variable or function called parseFloat but if you do then you will not be able to use the built-in function.
Examples:
var txt = '56.3'; var num = parseFloat(txt);
Explore JavaScript
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript
  4. Reference
  5. Javascript Glossary - Parsefloat

©2009 About.com, a part of The New York Times Company.

All rights reserved.