Siebel eScript Language Reference > Siebel eScript Commands > The Global Object >

ToNumber() Method


This function converts its parameter to a number.

Syntax

ToNumber(value)

Parameter
Description
value
The value to be converted to a number

Returns

A value that depends on value's original data type, according to the following table:

Data Type
Returns
Boolean
+0 if value is false, 1 if value is true
buffer
value if successful; otherwise, NaN
null
0
number
value
object
NaN
string
value if successful; otherwise, NaN
undefined
NaN

Usage

This function converts its parameter to a number.

CAUTION:  The ToNumber() function is unique to Siebel eScript. Avoid using it in a script that may be used with a JavaScript interpreter that does not support it.

See Also

ToInt32() Method, ToInteger() Method, ToString() Method, ToUint16() Method, ToUint32() Method, and Math.round() Method


 Siebel eScript Language Reference 
 Published: 18 April 2003