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

Connect CDC System Reference Guide

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (MIMIX Share)
Version
5.8
Language
English
Product name
Connect CDC
Title
Connect CDC System Reference Guide
Copyright
2024
First publish date
2003
ft:lastEdition
2024-02-12
ft:lastPublication
2024-02-12T15:11:59.486869

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)