This function truncates a number to a given integer.
Trunc([Number], [Number of Digits])
Where:
Number is the number, or reference to a number, that you want to truncate.
Number of Digits is the number of decimal places you require.
If the number of digits is set to 0 or left blank, the Trunc function, when calculated, will return the only integer part of the number.
If the number of digits has a value greater than 0, then the Trunc function, when calculated, will return the number rounded to the specified number of digits.
Rule | Meaning |
---|---|
Trunc(LengthTextBoxReturn/2, 2) | The return value from the LengthTextBox is divided by 2 and the result is rounded to 2 decimal places. |
LengthTextBoxReturn/2 Value | Number of Digits | Result of the Trunc function |
---|---|---|
17.482976 | 2 | 17.48 |
134.745734 | 0 | 134 |
348.5687 | 3 | 348.568 |