Skip to main content

truncate

Truncates a number to its integer part.

This function is a useful alternative to round and precision, both of which apply half-up rounding.

Tip

Use substring or the syntax for string slicing to truncate a string.

Parameters

  • INPUT NUMBER (number)

    A number to truncate.

Examples

ATL in Script

Result

[[truncate(3.99)]]

3

[[truncate(-3.99)]]

-3

[[truncate(3)]]

3

Note

If you input an integer, the function returns it unchanged.

You can use the function on decimal results from datetime functions such as asDays.

ATL in Script

Result

[[asDays(400000)]]

4.63

[[truncate(asDays(400000))]]

4