Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明

FLOOR——对给定的数字取整数位
SQL> select floor(2345.67) from dual;

FLOOR(2345.67)
--------------
2345

CEIL-- 返回大于或等于给出数字的最小整数
SQL> select ceil(3.1415927) from dual;

CEIL(3.1415927)
---------------
              4

ROUND——按照指定的精度进行四舍五入
SQL> select round(3.1415926,4) from dual;

ROUND(3.1415926,4)
------------------
            3.1416

TRUNC——按照指定的精度进行截取一个数
SQL> select trunc(3.1415926,4) from dual;

ROUND(3.1415926,4)
------------------
            3.1415

相关文章:

  • 2020-11-09
  • 2021-07-02
  • 2021-11-29
  • 2022-12-23
  • 2021-06-28
猜你喜欢
  • 2022-12-23
  • 2021-11-14
相关资源
相似解决方案