Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Numerical Math Functions
 

ROUND(x, [y]) gets the result of rounding x an optional y decimal places

If y is omitted, x is rounded to zero decimal places. If y is negative, x is rounded to the left of the decimal point. The following example uses ROUND() to display the result of rounding 5.75 to zero, 1, and -1 decimal places, respectively: SQL> SQL> SELECT ROUND(5.75), ROUND(5.75, 1), ROUND(5.75, -1) FROM dual; ROUND(5.75) ROUND(5.75,1) ROUND(5.75,-1) ----------- ------------- --------------           6           5.8             10 SQL>