数字 function
SELECT
TRUNC(15.79),
TRUNC(15.79,1),
ROUND(15.79),
ROUND(15.79,1),
ROUND(115.79,-2),
FLOOR(26.983),
CEIL(26.123),
SIGN(-25),
SIGN(0),
SIGN(25),
MOD(10,4)
FROM dual;
TRUNC(15.79) TRUNC(15.79,1) ROUND(15.79) ROUND(15.79,1) ROUND(115.79,-2) FLOOR(26.983) CEIL(26.123) SIGN(-25) SIGN(0) SIGN(25) MOD(10,4)
------------ -------------- ------------ -------------- ---------------- ------------- ------------ ---------- ---------- ---------- ----------
15 15.7 16 15.8 100 26 27 -1 0 1 2
TRUNC:
Returns the number or expression passed as parameter
Syntax:
TRUNC(original_number[,n])
The parameter for the number of decimals (n
original number to convert it into an integer.
If n is negative, the function truncates n digits to the left of the decimal point.
ROUND:
Returns the number or expression passed as parameter
Syntax:
ROUND(original_number[,n])
The parameter for the number of decimals (n
original number to convert it into an integer.
If n is negative, the function rounds off n digits to the left of the decimal point.
FLOOR:
Returns the largest integer that is equal to or less than
decimals from the original number, if it is not an integer.
integer.
Syntax:
FLOOR(original_number)
CEIL:
Returns the smallest integer that is greater than or equal to
number passed has decimals it returns the next integer.
Syntax:
CEIL(original_number)
SIGN:
Returns a number that represents the sign of the number passed as parameter
number passed is positive it returns 1, and it returns 0 if the number passed is 0.
Syntax:
SIGN(number)
MOD:
Returns the remainder of the first_number divided by
Syntax:
MOD(first_number,second_number)
数字 function的更多相关文章
- 常用function() 收集
1.随机数生成函数(来源-微信支付demo案例) /** * * 产生随机字符串,不长于32位 * @param int $length * @return 产生的随机字符串 */ public st ...
- JS实现输入框只能输入数字
键盘下落事件实现输入框只能输入数字: <script type="text/javascript"> // 实现输入框只能输入数字 function ValidateN ...
- PHP 汉字数字互转(100以内)| PHP 汉字转数字 | PHP数字转汉字
<?php function numDatabase(){ $numarr =array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,2 ...
- 在 shell 脚本获取 ip、数字转换等网络操作
在 shell 脚本获取 ip.数字转换等网络操作 ip 和数字的相互转换 ip转换为数字 :: function ip2num() { local ip=$1 local a=$(echo $ip ...
- EasyUI分页索引不能输入非数字
//分页索引不能输入非数字 function PagerCheck() { $(".pagination-num").keydown(function (event) { even ...
- 禁止输入中文 与 禁止输入数字在phonegap api环境效果
例子如下: <!doctype html> <html> <head> <meta charset="utf-8"> <tit ...
- EXCEL表格单元格中包含数字英文和汉字,如何自动去掉汉字,保留英文和数字
EXCEL表格单元格中包含数字英文和汉字,如何自动去掉汉字,保留英文和数字 Function 求数字和字母(对象 As String) '在文本与数字混杂中提取数字和字母 Dim myReg ...
- JavaScript过滤除连续的数字
if (!Array.prototype.forEach) { Array.prototype.forEach = function (callback, thisArg) { var T, k; i ...
- Javascript 正则表达式校验数字
$("input[datatype=number]").blur(function () { var str = $(this).val( ...
随机推荐
- Contest Hunter 模拟赛09 C [树形dp+差分]
题面 传送门 思路 又双叒叕是一道差分题我没想出来......记录一下 首先这个"所有祖先都比自己小"等价于"父亲比自己小" 这题的基础dp方程很显然,$dp[ ...
- git使用笔记(六)github
By francis_hao Nov 20,2016 github介绍 github是一个网站https://github.com/,可以实现基于git(当然,svn也是可以的)的代码托管工作. ...
- Ubuntu下安装LNMP之独立添加php扩展模块
使用php的过程中,发现某个扩展没有添加,又不想重新编译php,这个时候我们就需要单独添加需要的扩展模块. 下面以mysqli扩展模块为例,具体介绍安装步骤. 1.安装mysql 具体参考:Ubunt ...
- CSS盒模型之margin解析
原文链接:http://www.jianshu.com/p/ccb534e9b588 文章分为: margin的使用 margin的叠压现象 margin的子债父偿现象 一.margin的使用 HTM ...
- maven在add dependecy时搜索不出jar包的解决办法
一:前言 其实我一直都很头疼maven的项目管理的,因为觉得用起来还是没有那么方便的啊,不过今天我自己算是小弄了下maven项目的故那里,是一个同事在配置maven的项目,我去凑了下热闹而已,现在自己 ...
- [51nod] 1305 Pairwise Sum and Divide 数学
有这样一段程序,fun会对整数数组A进行求值,其中Floor表示向下取整: fun(A) sum = 0 for i = 1 to A.length for j = ...
- HASHMAP 深入解析
http://blog.csdn.net/ghsau/article/details/16843543/
- [BZOJ1982][POJ1740][Spoj 2021]Moving Pebbles|解题报告
这道题的题意BZ和POJ上的都不大清楚... 大概就是给出n堆石子,以及初始每堆石子的个数 两个玩家交替操作,每个操作可以任意在一堆中取任意多的石子 然后再从这堆里拿若干个石子放到某个当前还存在的堆里 ...
- Linux 工作站安全加固规范
目标受众 这是一套 Linux 基金会为其系统管理员提供的推荐规范. 这个文档用于帮助那些使用 Linux 工作站来访问和管理项目的 IT 设施的系统管理员团队. 如果你的系统管理员是远程员工,你也许 ...
- Python阶段复习 - part 2 - Python序列/持久化
1. 把一个数字的list从小到大排序,然后写入文件,然后从文件中读取出来文件内容,然后反序,在追加到文件的下一行中 >>> import json >>> imp ...