Proceed to WirelessDevNet Home Page
Publications, e-books, and more! Community Tutorials Store Downloads, tools, & Freebies! IT Career Center News Home
newnav.gif

Newsletters
EMail Address:



   Content
  - Articles
  - Columns
  - Training
  - Library
  - Glossary
 
   Career Center
  - Career Center Home
  - View Jobs
  - Post A Job
  - Resumes/CVs
  - Resource Center
 
   Marketplace
  - Marketplace Home
  - Software Products
  - Wireless Market Data
  - Technical Books
 
   News
  - Daily News
  - Submit News
  - Events Calendar
  - Unsubscribe
  - Delivery Options
 
   Community
  - Discussion Boards
  - Mailing List
  - Mailing List Archives
 
   About Us
  - About WirelessDevNet
  - Wireless Source Disks
  - Partners
  - About MindSites Group
  - Advertising Information
 
WMLScript Reference WMLScript Reference

WMLScript > Lang > parseFloat()

parseFloat() - The parseFloat Function

Usage:  
parseFloat(value)
Description:  Returns an floating-poing value defined by the string value. The legal integer syntax is specified by the WMLScript numeric string grammar for decimal floating-point literals with the following additional parsing rule:
  • Parsing ends when the first character is encountered that cannot be parsed as being part of the floating-poing representation.
The result is the parsed string converted to an floating-point value.


Example:
var a = Lang.parseFloat("123.7");                  // a = 123.7
var b = Lang.parseFloat("    +7.34e2 Hz");         // b = 7.34e2
var c = Lang.parseFloat("  70e-2 F");              // c = 70.0e-2
var d = Lang.parseFloat("-.1 C");                  // d = -0.1
var e = Lang.parseFloat(" 100 ");                  // e = 100.0
var e = Lang.parseFloat("Number: 5.5");            // f = invalid
var e = Lang.parseFloat("7.3e meters");            // g = invalid
var e = Lang.parseFloat("7.3e- m/s");              // h = invalid





Bookmark this page
Sponsors

Search

Eliminate irrelevant hits with our industry-specific search engine!









Wireless Developer Network - A MindSites Group Trade Community
Copyright© 2000-2010 MindSites Group / Privacy Policy
Send Comments to:
feedback@wirelessdevnet.com