How to: |
Given a numeric expression and an integer count, TRUNCATE returns the numeric expression truncated to that number of decimal places. If the number of decimal places is negative, it truncates to the left of the decimal point.
TRUNCATE(num_exp, count)
where:
Numeric
Is the numeric expression to be truncated.
Numeric
Is the number of decimal places to which the numeric expression is to be truncated. If the number of decimal places is negative, TRUNCATE truncates to the left of the decimal point.
The following request truncates the LISTPR field to 1 decimal place and to -1 decimal places.
TABLE FILE MOVIES PRINT LISTPR AND COMPUTE TRUNCATE_PLUS1/D12.3 = TRUNCATE(LISTPR, 1); TRUNCATE_MINUS1/D12.3 = TRUNCATE(LISTPR, -1); BY MOVIECODE WHERE RECORDLIMIT EQ 3 ON TABLE SET PAGE NOLEAD ON TABLE SET STYLE * GRID=OFF,$ ENDSTYLE END
The output is shown in the following image.