Siebel eScript Language Reference > Siebel eScript Commands > Conversion or Casting Methods >

parseInt() Method


This method converts an alphanumeric string to an integer number.

Syntax

parseInt(string)

Parameter
Description

string

The string to be converted

Returns

An integer number; if string cannot be converted to a number, the special value NaN is returned.

Usage

Whitespace characters at the beginning of the string are ignored. The first non-white-space character must be either a digit or a minus sign (-). Numeric characters in string are read. Reading stops at the first non-numeric character. The result is converted into an integer number. Characters including and following the first non-numeric character are ignored.

Example

The following code fragment returns the result -234:

var num = parseInt(" -234.37 profit");

Siebel eScript Language Reference