skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : To integer
 

Try Corticon Now

To integer

SYNTAX

<Decimal>.toInteger
<String>.tointeger

DESCRIPTION

Converts the value in <Decimal> or all characters in <String> to data type Integer. All decimals have fractional portions truncated during the conversion. Strings are converted ONLY if all characters in <String> are numeric, without a decimal point. If any non-numeric characters (with the sole exception of a single leading minus sign for negative numbers) are present in <String>, no value is returned by the function. Do not use on String values of null or empty String ( '' ) -- a pair of single quote marks -- as this will generate an error message.

USAGE RESTRICTIONS

The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.

RULESHEET EXAMPLE

The following Rulesheet uses .toInteger to convert decimal1 and string1 to type Integer and assign them to integer1 and integer2, respectively.

SAMPLE TEST