日期:2014-05-16  浏览次数:20416 次

oracle 四舍五入 取得的数值
SELECT ROUND( number, [ decimal_places ] ) FROM DUAL


--说明:
number :-- 将要处理的数值

decimal_places :-- 四舍五入,小数取几位,不填默认为0

Sample :


select round(987.456) from dual;           --  结果: 987

select round(987.456, 0) from dual;        --  结果: 987 

select round(987.456, 1) from dual;        --  结果: 987.5 

select round(987.456, 2) from dual;        --  结果:987.46 

select round(987.456, 3) from dual;        --  结果: 987.456 

select round(-987.456, 2) from dual;       --  结果:-987.46