SELECT ROUND( number, [ decimal_places ] ) FROM DUAL
说明:
number : 将要处理的数值
decimal_places : 四舍五入,小数取几位,不填默认为0
Sample :
select round(123.456) from dual; 结果: 123
select round(123.456, 0) from dual; 结果: 123
select round(123.456, 1) from dual; 结果: 123.5
select round(123.456, 2) from dual; 结果:123.46
select round(123.456, 3) from dual; 结果: 123.456
select round(-123.456, 2) from dual; 结果:-123.46
时间: 2024-10-12 20:50:54