8.75*0.01=0.08750000000000001?
js code:
<SCRIPT>
alert(8.85*0.01);
alert(8.75*0.01);
</SCRIPT>
运行一下就知道了,我这儿得到的8.75*0.01居然等于0.08750000...1
为什么?
[解决办法]
toFixed(3)
发布时间: 2012-02-19 19:43:37 作者: rapoo
8.75*0.01=0.08750000000000001?
js code:
<SCRIPT>
alert(8.85*0.01);
alert(8.75*0.01);
</SCRIPT>
运行一下就知道了,我这儿得到的8.75*0.01居然等于0.08750000...1
为什么?
[解决办法]
toFixed(3)