PL/SQL Round

The Round function round up any number to a certain number of decimal places or returns a date rounded to a specific unit of measure.

Round syntax

ROUND( number, [ decimal_numbers ] ) 

ROUND( date, [ format ] )

Round example

 
select round(215.138) from dual;		

Result: 215


select round(215.789) from dual;	

Result: 216


select round(215.138,2) from dual;	

Result: 215.14


select round(215.138,3) from dual;

Result: 215.138


select round(-215.781,2) from dual;	

Result: -215.78


select round(-215.788,2) from dual;	

Result: -215.79


select round(to_date ('27-DEC-14'),'YEAR') from dual;

Result: 01-JAN-2015 00:00:00


select round(to_date ('21-JAN-15'),'MONTH') from dual;

Result: 01-FEB-2015 00:00:00