Round function Usage:
Intercept numbers
The format is as follows: ROUND (Number[,decimals])
Where number is to be intercepted
Decimals indicates the number of digits that need to be retained after the decimal point. Optional, ignore it to truncate all the decimal parts, and rounded. A negative number indicates the digits to the left of the decimal points, the corresponding integer number is filled with 0, and the decimal is removed. It should be noted that, unlike the trunc function, the intercepted number is rounded.
Examples are as follows:
SQL code:
Sql> Select Round (1234.5678,4) from dual;
ROUND (1234.5678,4)
——————
1234.5678
Sql> Select Round (1234.5678,3) from dual;
ROUND (1234.5678,3)
——————
1234.568
Sql> Select Round (1234.5678,2) from dual;
ROUND (1234.5678,2)
——————
1234.57
Sql> Select Round (1234.5678,1) from dual;
ROUND (1234.5678,1)
——————
1234.6
Sql> Select Round (1234.5678,0) from dual;
ROUND (1234.5678,0)
——————
1235
Sql> Select Round (1234.5678,-1) from dual;
ROUND (1234.5678,-1)
——————-
1230
Sql> Select Round (1234.5678,-2) from dual;
ROUND (1234.5678,-2)
——————-
1200
Sql> Select Round (1234.5678,-3) from dual;
ROUND (1234.5678,-3)
——————-
1000
Additional:
Sql> Select Round (45.923,-1) from dual;
ROUND (45.923,-1)
——————-
50