JS Float精度问题 toPrecision
<script language="JavaScript">
var r=13.895+Math.pow(10,-3);
alert(r);
alert(r.toPrecision(6));
</script>
<script language='VBscript'>
dim r
r=13.895+0.001
msgbox r ' 13.896
</script>
<script language="JavaScript">
var r=13.895+Math.pow(10,-3);
alert(r);
alert(r.toPrecision(6));
</script>
<script language='VBscript'>
dim r
r=13.895+0.001
msgbox r ' 13.896
</script>