js中Math.round、parseInt、Math.floor和Math.ceil小数取整小结
摘要:
以前经常在代码中看到Math.round、parseInt、Math.floor和Math.ceil这四个函数,虽然知道结果都可以返回一个整数,但是对他们四者的区别还是不太清楚,今天就做一个小结。一、Math.round作用:四舍五入,返回参数+0.5后,向下取整。如:Math.round(5.57... 阅读全文
posted @ 2014-10-23 18:08 aaron_shu 阅读(4654) 评论(0) 推荐(0)
浙公网安备 33010602011771号