您的位置:首页 > Web前端 > JavaScript

JavaScript round() 方法【每日一段代码95】

2012-04-24 21:44 736 查看
<html>
<body>
<script type="text/javascript">
document.write(Math.round(0.60)+"<br />");
document.write(Math.round(0.50)+"<br />");
document.write(Math.round(0.49)+"<br />");
document.write(Math.round(-4.50)+"<br />");
document.write(Math.round(-4.60));
</script>
</body>
</html>

【round() 方法可把一个数字舍入为最接近的整数。】
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: