The DecimalToInteger function is a built-in function that converts Decimal d to an integer value.

In a .NET application server, the function rounds the input using the round half to even method. In a J2EE application server and in an Aggregate expression the function truncates to the integer part of the input.

If d is outside the boundaries of the Integer values, the function will return the Integer default value or Arithmetic Overflow Error in an Aggregate expression. To check if the conversion is possible you can use the DecimalToIntegerValidate function.

Input parameters

d: Decimal Type

Output parameters

Integer Type

Examples

Usage

Result

DecimalToInteger( 134.2 )

134

DecimalToInteger( 134.5 )

134

DecimalToInteger( 133.5 )

134 (in a .NET application server) or 133 (in a J2EE application server or in an Aggregate)

DecimalToInteger( 134.7 )

135 (in a .NET application server) or 134 (in a J2EE application server or in an Aggregate)

DecimalToInteger( 134 )

134

DecimalToInteger( 12345678999.9 )

0 (in a .NET or J2EE application server) or Arithmetic Overflow Error (in an Aggregate)

See Also

DecimalToIntegerValidate Function | Available Conversion Functions to Integer | Available Built-in Functions