摘要:
oFixed() 方法可把 Number 四舍五入为指定小数位数的数字。在本例中,我们将把数字舍入为仅有一位小数的数字:Show the number 13.37 with one decimal:<script type="text/javascript">var num = new Number(13.37);document.write (num.toFixed(1))</script>输出:Show the number 13.37 with one decimal:13.4 阅读全文