Rounding (rounding down):
Select Floor (5.534) from dual;
Select Trunc (5.534) from dual;
Both of the above can be rounded down to the number 5.534, and the result is 5.
If you want to take the whole up and get the result of 6, you should use Ceil
Select Ceil (5.534) from dual;
Rounded:
SELECT round (5.534) from dual;
SELECT round (5.534,0) from dual;
SELECT round (5.534,1) from dual;
SELECT round (5.534,2) from dual;
The results were 6, 6, 5.5, 5.53, respectively.
Keep n decimal places (not rounded):
Select Trunc (5.534,0) from dual;
Select Trunc (5.534,1) from dual;
Select Trunc (5.534,2) from dual;
The result is 5,5.5,5.53, which retains 0 decimal places as the equivalent of direct rounding.
Number formatting:
Select To_char (12345.123, ' 99999999.9999 ') from dual;
Result is 12345.123
Select To_char (12345.123, ' 99999999.9900 ') from dual;
After the third fourth of the decimal is insufficient to fill 0, the result is 12345.1230
Select To_char (0.123, ' 99999999.9900 ') from dual;
Select To_char (0.123, ' 99999990.9900 ') from dual;
The results were. 123, 0.123
Oracle decimal format up-down rounding