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