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 |
---|---|
| 3 |
| -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 |
---|---|
| 4.63 |
| 4 |