TRUNC returns the 1st argument truncated by the number of decimal places specified in the 2nd argument.

The 2nd argument can be either be a positive integer to specify the right of the decimal point or a negative number to specify the left of the decimal point.

If you are truncating to the left of the decimal point, the truncated digit will become 0.

Example:

SELECT TRUNC(12.43,1) as truncate FROM DUAL;

truncate
—————
12.4

SELECT TRUNC(12.43,-1) as truncate FROM DUAL;

truncate
—————
10

Trunc – Oracle SQL Function
Tagged on: