In Oracle / PLSQL, there is a rounding function, which is round (). In general, the command is as follows:
round (number, [decimal_places])
number is the number to be rounded
decimal places is the number of rounded decimal places. If not filled, then the result will be no number behind the comma.Example:
SELECT ROUND(15.193,0) FROM DUAL will return 15 SELECT ROUND(15.193,1) FROM DUAL will return 15.2 SELECT ROUND(15.193,2) FROM DUAL will return 15.19 SELECT ROUND(15.193,-1) FROM DUAL will return 20
What if rounded is not an integer? For example, floating point . Means will be rounded to even the closest number. Example:
SELECT ROUND(1.5f) FROM DUAL will return 2.0E+000 SELECT ROUND(2.5f) FROM DUAL will return 2.0E+000