How to use Math.ceil() in Javascript

Description

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

Example


console.log(Math.ceil(25.9)); //26 
console.log(Math.ceil(25.5)); //26 
console.log(Math.ceil(25.1)); //26 

The code above generates the following result.





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window