Truncate function
Syntax
Truncate(dec, digits)
Description
Use the Truncate function to truncate a decimal number dec to a specified precision.
Parameters
| Parameter | Description |
|---|---|
|
digits |
A Number value that sets the precision of the truncation (that is, the number of digits to leave on the right side of the decimal point). |
Returns
Returns a Number value equal to dec truncated to a digits precision.
Example
The example sets the value of &NUM to 9, 9.99, -9, then 0.
&NUM = Truncate(9.9999, 0);
&NUM = Truncate(9.9999, 2);
&NUM = Truncate(-9.9999, 0);
&NUM = Truncate(0.001, 0);
Related Topics