Convert Value to Number Method

The Convert Value to Number method converts the value that the value argument contains to a number. It returns a value that depends on the original data type of the value that the value argument contains. Convert Value to Bytes Method describes these data types.

This method is unique to Siebel eScript. For more information, see Make Sure the JavaScript Interpreter Can Run a Function.

This method uses the same argument as the Convert Value to Integer 32 method. For more information, see Convert Value to Integer 32 Method.

Format

ToNumber(value)

The following table describes values that the Convert Value to Number method returns.

Data Type Return Value

Boolean

This method returns one of the following values, depending on if the value that the value argument contains is:

  • False. It returns the following value:

+0

  • True. It returns the following value:

1

buffer

This method returns one of the following values, depending on if the conversion is:

  • Successful. It returns the value that the value argument contains.

  • Not successful. It returns the following value:

NaN

For more information on the number object, see NaN Numbers.

string

null

0

number

This method returns the value that the value argument contains.

object

NaN

undefined

Related Topics

For more information, see Round Number Method.