Transformation Language Reference > Functions > TO_BIGINT
  

TO_BIGINT

Converts a string or numeric value to a bigint value. TO_BIGINT syntax contains an optional argument that you can choose to round the number to the nearest integer or truncate the decimal portion. TO_BIGINT ignores leading blanks.

Syntax

TO_BIGINT( value [, flag] )
The following table describes the arguments for this command:
Argument
Required/
Optional
Description
value
Required
String or numeric datatype. Passes the value you want to convert to a bigint value. You can enter any valid transformation expression.
flag
Optional
Specifies whether to truncate or round the decimal portion. The flag must be an integer literal or the constants TRUE or FALSE.
TO_BIGINT truncates the decimal portion when the flag is TRUE or a number other than 0.
TO_BIGINT rounds the value to the nearest integer if the flag is FALSE or 0 or if you omit this argument.
The flag is not set by default.

Return Value

Bigint.
NULL if the value passed to the function is NULL.
0 if the value passed to the function contains alphanumeric characters.

Examples

The following expressions use values from the port IN_TAX:
TO_BIGINT( IN_TAX, TRUE )
IN_TAX
RETURN VALUE
'7245176201123435.6789'
7245176201123435
'7245176201123435.2'
7245176201123435
'7245176201123435.2.48'
7245176201123435
NULL
NULL
'A12.3Grove'
0
'    176201123435.87'
176201123435
'-7245176201123435.2'
-7245176201123435
'-7245176201123435.23'
-7245176201123435
-9223372036854775806.9
-9223372036854775806
9223372036854775806.9
9223372036854775806
TO_BIGINT( IN_TAX )
IN_TAX
RETURN VALUE
'7245176201123435.6789'
7245176201123436
'7245176201123435.2'
7245176201123435
'7245176201123435.348'
7245176201123435
NULL
NULL
'A12.3Grove'
0
'    176201123435.87'
176201123436
'-7245176201123435.6789'
-7245176201123436
'-7245176201123435.23'
-7245176201123435
-9223372036854775806.9
-9223372036854775807
9223372036854775806.9
9223372036854775807