Truncate is a mathematical function that removes the specified number of digits from numeric values.
Trunc (arg1, integer)
where arg1 is expressed by one of the following arguments:
A numeric value. For example, 234.567. For a description of numeric arguments, 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 For more information, see Row, Column, or Cell Reference Arguments. | |
An embedded function. For a list of mathematical functions, see Mathematical Functions. |
where integer specifies the number of digits you want to remove:
A positive integer determines the number of significant digits that remain 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 significant digits that are truncated 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