Convert decimal/double to int - Connect_CDC - connect_cdc_mimix_share - Latest

Connect CDC System Reference Guide

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (MIMIX Share)
Version
Latest
Language
English
Product name
Connect CDC
Title
Connect CDC System Reference Guide
Copyright
2024
First publish date
2003
Last edition
2024-08-20
Last publish date
2024-08-20T21:40:14.000381

Method:   Convert decimal/double to int

Function name:   tointeger

Parameter list:   (DECIMAL or DOUBLE)

Return type:   INTEGER

What the method does:   Converts the input decimal value to an integer; accepts decimal or double.

If there are fractional digits because the input value is a float or a decimal, then these digits to the right of the decimal point are truncated. For example:

  •    tointeger(1.234567)   results in -----> 1

  •    tointeger(3.56789)   results in -----> 3

If you want to “round”, then use either the round or the rounddecimal function:

Round, which accepts double, or decimal inputs, results in a rounded integer.

   round(1.234567)    results in -----> 1 (rounded down to 1)

   round(3.56789)   results in -----> 4 (rounded up to 4)

Rounddecimal rounds a decimal and has a decimal result.

rounddecimal(123.4567,3);   results in -----> 123.457 (rounded to the nearest 3 decimal places)