Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p>Click the button to round different numbers upwards to the nearest integer.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var a = Math.ceil(0.60); var b = Math.ceil(0.40); var c = Math.ceil(5); var d = Math.ceil(5.1); var e = Math.ceil(-5.1); var f = Math.ceil(-5.9); var x = a + "<br>" + b + "<br>" + c + "<br>" + d + "<br>" + e + "<br>" + f; document.getElementById("demo").innerHTML = x; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_ceil2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:26:47 GMT --> </html>
Result:
Try it Yourself - © w3schools.com