Round(exp1,exp2)函数具有四舍五入的功能,分为以下两种情况:
1.exp2数为非负
四舍五入的位数从小数点后开始计数,小数点后|exp2|位,看後一位,进本位,后面舍去
select Round(125.455,0) from dual ---125 select Round(125.455,1) from dual ---125.5 select Round(125.455,4) from dual ---125.455 大于小数位数,其余的位数补0将不显示
2.exp2数为负
四舍五入的位数从小数点前开始计数,小数点前|exp2|位,看本位,进前一位,本位以及后面取0
select Round(125.455,-1) from dual ---130 select Round(125.455,-2) from dual ---100 select Round(125.455,-3) from dual ---0 select Round(125.455,-4) from dual ---0