Math.ceil() in javascript

     The Math.ceil() function returns the smallest integer greater than or equal to a given number. ceil() is a static method of Math, you always use it as Math.ceil(), rather than as a method of a Math object you created (Math is not a constructor).

Syntax

   Math.ceil(number);


Example

   Math.ceil(.97);   // 1

   Math.ceil(0.3);     // 1

   Math.ceil(3);     // 3

   Math.ceil(7.003); // 8


Example Program:- (Editor)


Editor is Loading...

Advertisement

Nhận xét

Bài đăng phổ biến từ blog này

How to set the SDK, NDK and JDK path to android studio?

if statement

Select all values from list box in a single click using javascript