Truncate is a mathematical function that removes the specified number of digits from numeric values.
Trunc(arg1,integer)
where arg1 is one of the following values:
A numeric value. For example, 234.567. See Numeric Arguments. | |
A pointer to a row, column, or cell within a grid. References can be specified in several ways. The reference syntax is: GridName.GridElement[segment(range)].property. See Row, Column, or Cell Reference Arguments. | |
Integer specifies the number of digits to remove:
A positive integer determines the number of digits to the right of the decimal point.
A zero (0) integer returns the integer located to the left of the decimal point.
A negative integer indicates the number of digits to the left of the decimal point.
The following statement uses a positive integer of 2. The first two digits to the right of the decimal point remain, and the following digit is removed:
Trunc(234.567, 2) = 234.56
The following statement uses a zero (0) integer. All digits to the right of the decimal point are removed:
Trunc(234.567, 0) = 234
The following statement uses a negative integer of -2. All digits to the right of the decimal point are removed and the last 2 digits of the integer are truncated.
Trunc(234.567, -2) = 200