FUNCTION:  Lang.isFloat

The Lang.isFloat function returns a boolean value that indicates whether a string value can be converted into a floating-point number using the Lang.parseFloat function. A true signifies that you can convert. A false signifies that you cannot convert.
You can use the Lang.float function to determine if the browser supports floating-point arithmetic operations. Also, the Float Library contains several functions that are designed to be used with floating-point numbers.
The value parameter is the string value that you need converted into a floating-point number.
Code for IsFloatExample.wml
<?xml version="1.0"?>

<card id="card1">
   isFloat example
   <do type="accept">
      <go href="IsFloatExample.wmls#findisfloat( )" />

<card id="card2">
   can convert = $(isfloattest)


Code for IsFloatExample.wmls
extern function findisfloat( )
   var str = Dialogs.confirm("Enter a string", "");
   var result = Lang.isFloat(str);
   WMLBrowser.setVar("isfloattest", result);

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information