oracle round、trunc 四舍五入函数
来源:互联网 发布:语音与数据漫游是什么 编辑:程序博客网 时间:2024/04/29 08:35
如何使用 Oracle Round 函数 (四舍五入)描述 : 传回一个数值,该数值是按照指定的小数位元数进行四舍五入运算的结果。SELECT ROUND( number, [ decimal_places ] ) FROM DUAL参数:number : 欲处理之数值decimal_places : 四舍五入 , 小数取几位 ( 预设为 0 )Sample :select round(123.456, 0) from dual; 回传 123 select round(123.456, 1) from dual; 回传 123.5 select round(123.456, 2) from dual; 回传 123.46 select round(123.456, 3) from dual; 回传 123.456 select round(-123.456, 2) from dual; 回传 -123.46
如果decimal_places为负数
select round(123.456, -1) from dual; 回传 120
select round(123.456, -2) from dual; 回传 100也可以参考下面的博客:http://blog.csdn.net/cheungjustin/article/details/5659756trunc(x[,y]) 【功能】返回x按精度y截取后的值 【参数】x,y,数字型表达式,如果y不为整数则截取y整数部分,如果y>0则截取到y位小数,如果y小于0则截取到小数点向左第y位,小数前其它数据用0表示。 【返回】数字 【示例】 select trunc(5555.66666,2.1),trunc(5555.66666,-2.6),trunc(5555.033333) from dual; 返回:5555.66 5500 5555 【相近】round(x[,y]) 返回截取后的值,用法同trunc(x[,y]),只是要做四舍五入 详细出处参考:http://www.jb51.net/article/32289.htm
- oracle round、trunc 四舍五入函数
- Oracle trunc()函数的用法及四舍五入 round函数
- Oracle的取整和四舍五入函数——floor,round,ceil,trunc
- Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明
- Oracle的取整和四舍五入函数——floor,round,ceil,trunc
- Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明
- Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明
- Oracle的取整和四舍五入函数——trunc,round,ceil,floor使用说明
- Oracle的取整和四舍五入函数——floor,round,ceil,trunc使用说明
- Oracle round 函数(四舍五入)
- Oracle ROUND 、TRUNC 函数使用方法
- Oracle round和trunc函数
- oracle中函数round()与函数trunc()
- oracle 函数大全 之 trunc round
- Oracle中的Round和Trunc函数区别
- oracle round()函数 ----四舍五入函数
- oracle trunc/round用法
- 如何使用 Oracle Round 函数 (四舍五入)
- Ubuntu 12.04安装nodejs折腾记
- Android LCD(三):Samsung LCD接口篇
- bean标签
- jquery表单验证扩展一
- 小米公司2013校园招聘笔试题(研发)+答案
- oracle round、trunc 四舍五入函数
- HandlerSocket协议及PHP客户端应用
- MiniJSON
- C#对文本文件的读写
- [OpenGL]纹理坐标的自动生成glTexGen
- 兔子生仔问题
- 色彩知识的运用 和 色彩意境解析
- 在jsp下判断列表是否存在的 另类思路
- flash跨域策略文件crossdomain.xml配置详解