round函数的用法

round函数的用法

首页维修大全综合更新时间:2023-09-22 07:41:37

round函数的用法

语法:

round(number,digits)

参数:

number,要四舍五入的数,digits是要小数点后保留的位数

如果 digits 大于 0,则四舍五入到指定的小数位。   如果 digits 等于 0,则四舍五入到最接近的整数。   如果 digits 小于 0,则在小数点左侧进行四舍五入。

如果round函数只有参数number,等同于digits 等于 0。

返回值:

四舍五入后的值

举例:

round(3.1415926,2)=3.14;

round(3.1415926,3)=3.142;

select round(193,-2)from dual; 200

select round(193,-1)from dual;190

select round(193,-3)from dual;0

Round函数出错处理

大家还看了
也许喜欢
更多栏目

© 2021 3dmxku.com,All Rights Reserved.