2010年3月22日

js四舍五入

摘要: js中可以使用Math.round实现整数的四舍五入,如果需要实现精确到小数点多少位则需要编写函数了。function ForDight(Dight,How) { Dight = Math.round(Dight*Math.pow(10,How))/Math.pow(10,How); return Dight; } 本文转载自<这一技客> http://www.geekso.com/ 阅读全文

posted @ 2010-03-22 09:43 Snowwolf 阅读(156) 评论(0) 推荐(0) 编辑

导航