Home Search

DriveWorks Pro 22
Trunc

Send Feedback

Trunc

This function truncates a number to X decimal places.

Syntax

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.

Examples

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.

Example Outcomes

LengthTextBoxReturn/2 Value

Number of Digits

Result of the Trunc function

17.482976217.48
134.7457340134
348.56873348.568