TRUNC(x [, y]) Returns the result of truncating x an optional y decimal places : TRUNC « Numeric Math Functions « Oracle PL / SQL






TRUNC(x [, y]) Returns the result of truncating x an optional y decimal places


SQL>
SQL> --TRUNC(x [, y]) Returns the result of truncating x an optional y decimal places. 
--If y is omitted, x is truncated to zero decimal places. If y is negative, x is truncated to 
--the left of the decimal point.
SQL>
SQL>
SQL> select TRUNC(5.75) from dual;

TRUNC(5.75)
-----------
          5

SQL>

           
       








Related examples in the same category

1.TRUNC() returns its argument truncated to the number of decimal places specified with the second argument.
2.The value 109.29 was truncated to the single digit on the left side of the decimal point
3.TRUNC: Returns the truncated value (removes decimal part of a number, precision adjustable)
4.TRUNC with precision
5.TRUNC(44.647, 0)
6.TRUNC(44.647, -1)
7.TRUNC(Number,1): truncate values from a column
8.TRUNC(Number,-1)
9.select trunc( 12345.67890 )
10.select trunc( 12345.67890, 2 )
11.Use TRUNC in PL/SQL
12.TRUNC Demo