Siebel eScript Language Reference > Siebel eScript Commands > Conversion Methods >
ToNumber() Method
This function converts its parameter to a number. Syntax
ToNumber(value)
|
|
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.
|
|
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. Before using it, confirm that the JavaScript interpreter that will run the script supports Siebel eScript functions. Avoid using this function in a script that may be used with a JavaScript interpreter that does not support it.
See Also
Math.round() Method toFixed() Method ToInteger() Method ToString() Method ToUint16() Method ToUint32() Method
|