oracle Round() 函数

前端之家收集整理的这篇文章主要介绍了oracle Round() 函数前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
oracle Round() 函数

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

猜你在找的Oracle相关文章