如何使用 Oracle Round 函數(shù) (四舍五入)
描述 : 傳回一個(gè)數(shù)值,該數(shù)值是按照指定的小數(shù)位元數(shù)進(jìn)行四舍五入運(yùn)算的結(jié)果。
SELECT ROUND( number, [ decimal_places ] ) FROM DUAL
參數(shù):
number : 欲處理之?dāng)?shù)值
decimal_places : 四舍五入 , 小數(shù)取幾位 ( 預(yù)設(shè)為 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