Math.ceil()

The Math.ceil() method is the ceiling function. Math.ceil() rounds numbers up to the nearest integer value.

 
<!DOCTYPE html>
<html>
<head>
    <title>Example</title>
    <script type="text/javascript">
        document.writeln(Math.ceil(25.9)); //26 
        document.writeln(Math.ceil(25.5)); //26 
        document.writeln(Math.ceil(25.1)); //26 

    </script>
</head>
<body>
</body>
</html>
  
Click to view the demo
Home 
  JavaScript Book 
    Essential Types  

Math:
  1. The Math Object
  2. Math min() and max() Methods
  3. Math.ceil()
  4. Math.floor()
  5. Math.round()
  6. random() Method