Skip to main content

Celonis Product Documentation

TO_INT
Description

TO_INT converts STRING input to INT output. If the input does not represent an integer number (or the value of the representation is outside of the supported INT range), the function returns NULL.

Supported input column type: STRING. Use of the decimal separator or scientific E notation in input strings is not supported in TO_INT, and will be mapped to NULL. Trailing and leading whitespaces will be automatically removed and the trimmed STRING will be converted to an INT.

Output column type: INT.

Syntax
 TO_INT ( table.column )
Null handling

If the input value is NULL, the output value is NULL as well.

Example

[1]

Convert strings to integers. Note the NULL output for the following STRING input:

  • NULL

  • The empty string

  • Use of decimal separator

  • Scientific E notation. Example: 4.70E+2

  • Values outside the range for INT

Query

Column1

         TO_INT ( "Table1"."Column1" )
        

Input

Output

Table1

Column1 : string

null

''

'123456'

'-123456'

'1.11'

'-9.99'

'12345699'

' '

' 1'

'-2 '

' 45 '

'4E2'

'-5.93E-2'

'9223372036854775807'

'-9223372036854775808'

'9223372036854775908'

'-9223372036854775809'

Result

Column1 : int

null

null

123456

-123456

null

null

12345699

null

1

-2

45

null

null

9223372036854775807

-9223372036854775808

null

null

See also: