Round "5.3" to the nearest integer, and display it. - Javascript Math

Javascript examples for Math:Quiz

Description

Round "5.3" to the nearest integer, and display it.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = Math.round(5.3);
</script>//from w  ww  . jav  a  2s. c  o  m

</body>
</html>

Related Tutorials