JavaScript Math Object : ceil()

The ceil() method returns the smallest integer greater than or equal to a number. Syntax :
  Math.ceil( number );
Example :
<script>
  var x = -5.32;
  var y = Math.ceil(x);
  document.write("ceil(-5.32) : " + y + "<br/>");
  var x = 12.56;
  var y = Math.ceil(x);
  document.write("ceil(12.56) : " + y + "<br/>");
  var x = 20.49;
  var y = Math.ceil(x);
  document.write("ceil(20.49) : " + y + "<br/>");
</script>
Output :


Next Topic :