Siebel eScript Language Reference > Methods Reference > Conversion Methods >

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. Table 94 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 Table 95.

Format

ToNumber(value)

Values That the Convert Value to Number Method Returns

Table 96 describes values that the Convert Value to Number method returns.

Table 96. 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.

Siebel eScript Language Reference Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.