- Instant help with your JavaScript coding problems

Round up a number in JavaScript

Question:
How to round up a number in JavaScript?
Answer:
const num = Math.ceil(12.1);

console.log(num);
Description:

The Math.ceil() function always rounds a number up to the next largest integer.

Reference:
Math.ceil reference
Share "How to round up a number in JavaScript?"