zoukankan      html  css  js  c++  java
  • Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明

    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
  • 相关阅读:
    Dice 5 ==> dice 7
    Dice 7 ==> dice 5
    100 floors 2 eggs
    Determine overlapping rectangles
    Product of integers
    Maximum profit of stocks
    样式表
    20170508
    2017年05月07
    The second day of school
  • 原文地址:https://www.cnblogs.com/PatrickLee/p/4169006.html
Copyright © 2011-2022 走看看