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

(2011-04-06 16:10:35)

标签:

分类: 渐行渐远

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

问题:oracle floor;结果:Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明的更多相关文章

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

    Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明 FLOOR——对给定的数字取整数位SQL> select floor(2345.67) from dua ...

  2. Python向上取整,向下取整以及四舍五入函数

    import math f = 11.2 print math.ceil(f) #向上取整 print math.floor(f) #向下取整 print round(f) #四舍五入 #这三个函数的 ...

  3. Python 之 向上取整、向下取整以及四舍五入函数

    import math f = 11.2 print math.ceil(f) #向上取整 print math.floor(f) #向下取整 print round(f) #四舍五入 #这三个函数的 ...

  4. Oracle SQL语句操作数字:取整、四舍五入及格式化

    用oracle sql对数字进行操作: 取上取整.向下取整.保留N位小数.四舍五入.数字格式化 取整(向下取整): select floor(5.534) from dual;select trunc ...

  5. 【转载】Javascript使用Math.floor方法向下取整

    在Javascript的数值运算中,很多时候需要对最后计算结果向下取整,Math.floor是javascript中对计算结果向下取整的函数,它总是将数值向下舍入为最接近的整数.此外Math.ceil ...

  6. JS对象 向下取整floor() floor() 方法可对一个数进行向下取整。 语法: Math.floor(x)

    向下取整floor() floor() 方法可对一个数进行向下取整. 语法: Math.floor(x) 参数说明: 注意:返回的是小于或等于x,并且与 x 最接近的整数. 我们将在不同的数字上使用 ...

  7. Sql 获取向上取整、向下取整、四舍五入取整的实例

    [四舍五入取整截取] select round(54.56,0) [向下取整截取] SELECT FLOOR(54.56) [向上取整截取]  SELECT   CEILING(13.15) --MS ...

  8. SQL 向上取整、向下取整、四舍五入取整的实例!round、rounddown、roundup

    sql server ==================================================== [四舍五入取整截取] select round(54.56,0) === ...

  9. Sql Server 里的向上取整、向下取整、四舍五入取整

    ==================================================== [四舍五入取整截取] select round(54.56,0) ============== ...

随机推荐

  1. C#使用Sockets操作FTP

    http://blog.csdn.net/foart/article/details/6824551 using System; using System.Collections; using Sys ...

  2. QT 使用QSettings读写ini配置文件

    利用Qsettings包一个类 RWIniFile, writeIni方法写文件, readIni方法读文件 rwinifile.h #ifndef RWINIFILE_H #define RWINI ...

  3. 彻底弄清python的切片

    lis = range(100) # [0, 1, 2, 3, ..., 99] # 取前10个 lis[:10] # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] # 取后10个 l ...

  4. struts学习(3)

    1 ognl概述 2 ognl入门案例 3 什么是值栈 (1)servlet和action区别 (2)值栈存储位置 4 如何获取值栈对象 5 值栈内部结构 6 向值栈放数据 (1)s:debug标签 ...

  5. tomcat配置 启动

     <Context docBase="E:\apache-tomcat-7.0.50\wtpwebapps\mycms" path="" reloadab ...

  6. UML类图(二)----------类与类之间的关系之关联(聚合与组合)

    类与类之间的关系: 在软件系统中,类并不是孤立存在的,类与类之间存在各种关系,对于不同类型的关系,UML提供了不同的表示方式.       1. 关联关系 关联(Association)关系是类与类之 ...

  7. LeetCode OJ:Unique Paths(唯一路径)

    A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The ...

  8. winform中DataGridView使用DataGridViewCheckBoxColumn实现RadioBox单选功能

    private void dgvMaterial_CellContentClick(object sender, DataGridViewCellEventArgs e) { ; i < dgv ...

  9. hdoj-1017-A Mathematical Curiosity(格式坑)

    题目链接 /* Name: Copyright: Author: Date: 2018/5/3 16:32:15 Description: */ #include <iostream> # ...

  10. UVALive 3708 Graveyard(思维题)

    将原有的每个雕塑的坐标位置,映射在一个总长为n+m的数轴上,设第一个点的坐标为0,(新的等分点必然有至少有一个和原来n等分的等分点重合,因为等分点可以等距的绕圆周旋转,总可以转到有至少一个重合的,不妨 ...