개발하자/자바스크립트
Math객체
i구야
2015. 2. 24. 17:32
[ex]
<html>
<body>
<script>
document.write(Math.ceil(3.6)+"<br>"); // 올림
document.write(Math.round(3.6)+"<br>"); // 반올림
document.write(Math.floor(3.6)); // 내림
</script>
</body>
</html>
[ex]
<html>
<body>
<script>
document.write(Math.random());
</script>
</body>
</html>