您的位置:首页 > 数据库 > Oracle

Oracle round函数是什么意思?怎么运用?

2016-11-25 08:51 411 查看
如何使用 Oracle Round 函数 (四舍五入)
描述 : 传回一个数值,该数值是按照指定的小数位元数进行四舍五入运算的结果。
SELECT ROUND( number, [ decimal_places ] ) FROM DUAL
参数:
number : 欲处理之数值
decimal_places : 四舍五入 , 小数取几位 ( 预设为 0 )
Sample :
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: