以整数形式返回这个Number的值; toInt方法在String上也有
以浮点数形式返回这个Number的值;toFloat方法在String上也有
给数值设置限制范围
min | 数值, 最小值 |
max | 数值, 最大值 |
符合给定范围的值
(12).limit(2, 6.5) // 返回 6.5 (-4).limit(2, 6.5) // 返回 2 (4.3).limit(2, 6.5) // 返回4.3
返回经过取舍后的数值
precision | 整数, 小数点后的位数。可以为负数或者为0 (默认). |
12.45.round() // 返回 12
12.45.round(1) // 返回 12.5
12.45.round(-1) // 返回 10
取舍后的值
传入一个函数,执行这个韩素该数值表示的次数
function | 要执行的函数 |
(4).times(alert);
Documentation by Aaron Newton & Mootools Developers, generated by NaturalDocs and tidy, and GeSHi
文档中文翻译:zarknight 勘误Email:zarknight@gmail.com asp之家