Truncate a Number
Truncates a decimal number to a specified precision without rounding.
Overview
This procedure removes digits from a decimal number beyond a specified number of decimal places, effectively shortening the number without rounding it up or down. If no precision is provided, the number is truncated to an integer (zero decimal places).
Syntax
Below is a line-by-line overview of the automation syntax. Expand each line to learn more.
Examples
1. Truncate a Number (No Specified Precision)
truncate the number with
the number is 123.4567
2. Truncate a Number with Precision 3
the number is 123.4567
truncate the number with
the precision is 3
3. Truncate a Number with Precision 0
the number is 3.14159
truncate the number with
the precision is 0
4. Truncate a Negative Decimal
the number is -3.14159
truncate the number with
the precision is 3
5. Truncate a Number (Alternative Syntax)
the number is 123.4567
truncate the number with
the precision is 2
Last updated
Was this helpful?