15 1 0 4000 1 https://codeblock.co.za 300 true 0

Math.ceil()

0 Comments

Programming Language

JavaScript [Version: ECMAScript (ECMA-262)]

Syntax

Typical Usage

Rounds a number up to the next largest integer.

Accepted Parameters

  • value (integer) (Required): The float value you wish to round up.

Return Value(s)

The number rounded up.

Notes

Math.ceil(null) returns integer 0 without a NaN error.

Examples of Math.ceil()

Example 1

console.log(Math.ceil(2.1234))
// Output = 3

The above output will be 3.

Example 2

console.log(Math.ceil(68.7654))
// Output = 69

The above output will be 69.


Similar Functions in Other Languages

Was This Helpful?

Next Post
Math.floor()

0 Comments

Leave a Reply