摘要: js对于数字的操作Math.ceil(number):向上取整实例: Math.ceil(5.02)得出6与之相反的是:Math.floor(number):取整数部分实例:Math.floor(5.02)得出5Math.round(number),四舍五入。实例:Math.round(5.49)===5,Math.round(5.50)===5Math.PI圆周率值:3.1415926.。。Math.random() :输出0-1之间一个随机数number.toPrecision(count):count表示要保留整个数字的位数,并会把数字转化为字符串,如3.12.toPrecision(2 阅读全文
posted @ 2012-11-14 15:12 胡布内尔 阅读(299) 评论(0) 推荐(0)