js取数字精度问题
在一个input输入框里面输入数字,带小数位的,怎么取精度到2位并且要实现四舍五入?不够加分呵呵。
[解决办法]
http://hi.baidu.com/lael80/blog/item/d0bd46df1941d31248540363.html
formatnumber(this.value, false, 2, true)
发布时间: 2012-03-14 12:01:12 作者: rapoo
js取数字精度问题
在一个input输入框里面输入数字,带小数位的,怎么取精度到2位并且要实现四舍五入?不够加分呵呵。
[解决办法]
http://hi.baidu.com/lael80/blog/item/d0bd46df1941d31248540363.html
formatnumber(this.value, false, 2, true)