Round( ) 函数
传回一个数值,该数值是按照指定的小数位元数进行四舍五入运算的结果
语法
ROUND( number,decimal_places )
number : 需四舍五入处理的数值
decimal_places : 四舍五入,小数取几位 ( 预设为 0 )
返回值类型
数字
例子
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