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

Try Corticon Now

To decimal

SYNTAX

<Integer>.toDecimal
<String>.toDecimal

DESCRIPTION

Converts the value in <Integer> or all characters in <String> to data type Decimal. Converts a String to Decimal ONLY if all characters in <String> are numeric and contain not more than one decimal point. If any non-numeric characters are present in <String> (other than the single decimal point or a leading minus sign), no value is returned by the function.
Note: Integer values may be assigned directly to Decimal data types without using the .toDecimal operator because a Decimal data type is more expansive than an Integer.

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 .toDecimal to convert integer1 and string1 to type Decimal and assign them to decimal1 and decimal2, respectively.

SAMPLE TEST