WMLScript parseFloat() Function
Complete WMLScript Lang Library
The parseFloat() function returns a floating-point value defined by the string value.
The parsing ends on the first character that cannot be parsed as a floating-point value.
Syntax
|
n = Lang.parseFloat(string)
|
| Part |
Description |
| n |
The floating-point value returned from the function |
| string |
A string |
Example
var a = Lang.parseFloat("2345.14");
var b = Lang.parseFloat(" -4.45e2 Kg");
var c = Lang.parseFloat(" +4.45e2 Kg");
var d = Lang.parseFloat("-.3 C");
var e = Lang.parseFloat(" 300 ");
|
Result
a = 2345.14
b = -4.45e2
c = 4.45e2
d = -0.3
e = 300.0
|
Complete WMLScript Lang Library
 |
W3Schools' Online Certification Program
The perfect solution for professionals who need to balance work, family, and career building.
More than 4000 certificates already issued!
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|