Jquery 乘除运算怎样减少浮点数误差?
1 回答

宝慕林4294392
TA贡献2021条经验 获得超8个赞
jQuery貌似没得乘除这样的方法
直接用JS处理一下计算结果就好
functon format(num,length){
return Math.round(num*Math.pow(10,length))/Math.pow(10,length);
}
第一个参数传计算结果,第二个参数传保持的小数点的位数
- 1 回答
- 0 关注
- 568 浏览
添加回答
举报
0/150
提交
取消