The dectolong() function

The dectolong() function converts a decimal type number into an int4 type number.

Syntax

mint dectolong(dec_val, lng_val)
   dec_t *dec_val;
   int4  *lng_val;
dec_val
A pointer to the decimal structure that contains the value to convert to an itn4 integer.
lng_val
A pointer to an int4 variable to contain the result of the conversion.

Return values

0
The conversion was successful.
-1200
The magnitude of the decimal type number is greater than 2,147,483,647.