关于ExtJS对javascript中的Number的扩展,能够參考其帮助文档,文档下载地址:http://download.csdn.net/detail/z1137730824/7748893

以下对当中的部分方法进行介绍:

(1)constrain

constrainNumber number, Number min, Number max )
Number

检查给定的数值是否在约束的范围内。 If the number is already within the 假设再范围内就返回此数值。否则,假设大于最大值则返回最大值,假设小于最小值则返回最小值。, otherwise the min or max value is returned depending on which side of the range is 注意本方法不改变给定的数值本身。 Note that this method returns the constrained value but does
not change the current number.

Parameters

  • number : Number

    要检查的数值

  • min : Number

    范围的最小值

  • max : Number

    范围的最大值

Returns

  • Number

    The constrained value if outside the range, otherwise the current value

(2)randomInt,随机产生一个范围内的随机数

randomIntNumber from, Number to )
Number

Returns a random integer between the specified range (inclusive)

Parameters

  • from : Number

    Lowest value to return.

  • to : Number

    Highst value to return.

(3)toFixed,四舍五入取得输入的数值的小数点后几位

toFixedNumber value, Number precision )

Formats a number using fixed-point notation

Parameters

  • value : Number

    The number to format

  • precision : Number

    The number of digits to show after the decimal point

ExtJS学习-----------Ext.Number,ExtJS对javascript中的Number的扩展的更多相关文章

  1. ExtJS学习-----------Ext.Array,ExtJS对javascript中的Array的扩展

    关于ExtJS对javascript中的Array的扩展.能够參考其帮助文档,文档下载地址:http://download.csdn.net/detail/z1137730824/7748893 因为 ...

  2. ExtJS学习-----------Ext.String,ExtJS对javascript中的String的扩展

    关于ExtJS对javascript中的String的扩展,能够參考其帮助文档,文档下载地址:http://download.csdn.net/detail/z1137730824/7748893 以 ...

  3. ExtJS学习-----------Ext.Object,ExtJS对javascript中的Object的扩展

    关于ExtJS对javascript中的Object的扩展.能够參考其帮助文档,文档下载地址:http://download.csdn.net/detail/z1137730824/7748893 以 ...

  4. 关于ExtJS对javascript中的Object的扩展

    关于ExtJS对javascript中的Object的扩展,可以参考其帮助文档,文档下载地址:http://download.csdn.net/detail/z1137730824/7748893 下 ...

  5. 前端学习 第六弹: javascript中的函数与闭包

    前端学习 第六弹:  javascript中的函数与闭包 当function里嵌套function时,内部的function可以访问外部function里的变量 function foo(x) {   ...

  6. how to convert a number to a number array in javascript without convert number to a string

    how to convert a number to a number array in javascript without convert number to a string 如何在不将数字转换 ...

  7. ExtJS学习--------Ext.Element中的经常使用事件和其它重要的方法学习(实例)

    经常使用事件: 其它重要方法: 详细实例:(实例结果能够将相应的代码取消凝视进行測试) Ext.onReady(function(){ Ext.create('Ext.panel.Panel',{ t ...

  8. ExtJs学习笔记(1)---ExtJs安装及其使用

    从官网下载了ExtJs的3.2版本号的SDK,包括了代码依赖的具体说明.文档.范例和其它文件.当中,adapter和resources文件是Ext正常执行所必须的,其它的仅在开发过程中使用到. Ada ...

  9. ExtJS学习-----------Ext.Array,ExtJS对javascript中的Array的扩展(实例)

    (1)clean var arr = [1,2,null,3,'']; alert(Ext.Array.clean(arr)); //clean的对象:(value === null) || (val ...

随机推荐

  1. Ucan23操作系统项目地址

    期间耽误了近半年的时间.在昨天最终完毕了Ucan23OS, 项目托管在GitHub上,地址为: https://github.com/howardking/UCAN23OS 以下为操作系统的执行截图 ...

  2. U7Linux文件与目录管理

    1. .:代表当前层目录. ..:代表上一层目录. -:代表前一个工作目录. ~:代表目前用户所在的主文件夹. ~account:代表account这个用户的主文件夹. 2.pwd:显示当前目录. p ...

  3. CSharp Oracle 登陆

    =======后台Oracle存储过程================ 1.创建表 --判读表存在先删除begin    EXECUTE IMMEDIATE 'DROP TABLE student'; ...

  4. hdu1513 (滚动数据压缩空间)

    给定一个字符串,问最少添加多少个字符可以使得这个字符串变成回文串 if(str[i]==str[j]) dp[i][j] = dp[i+1][j-1] else dp[i][j] = min(dp[i ...

  5. PHP 字符串正则替换函数preg_replace使用说明

    1. preg_replace() $msg = preg_replace("/<style>.+<\/style>/is", "", ...

  6. Android Material Design-Creating Lists and Cards(创建列表和卡)-(三)

    转载请注明出处:http://blog.csdn.net/bbld_/article/details/40430319 翻译自:http://developer.android.com/trainin ...

  7. POJ 2533-Longest Ordered Subsequence(DP)

    Longest Ordered Subsequence Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 34454   Acc ...

  8. 王立平--include在Android应用

    它包括一个布局和布局 1.在layout确定activity_other.xml布局 2.代码中的包括例如以下: <LinearLayout xmlns:android="http:/ ...

  9. [ios仿系列]仿支付宝手势解码

    呀~.这么快就转到ios阵营了???.android还有那么多坑呢???为此我也仅仅能啃着馒头留下屈辱的眼泪了. . 本次因为开发公司产品的android版,继而ios版也负责一部分.当中一部分就是手 ...

  10. POJ 2250 Compromise (UVA 531)

    LCS问题.基金会DP. 我很伤心WA非常多.就在LCS问题,需要记录什么路. 反正自己的纪录path错误,最后,就容易上当. 没有优化,二维阵列,递归打印,cin.eof() 来识别 end of ...