Javatpoint Logo
Javatpoint Logo

JavaScript Math round() method

The JavaScript math round() method rounds up the given number up to the closest integer value and returns it. If the given number is already an integer, the round() method returns it directly.


The round() method is represented by the following syntax:


num - A number.


The closest integer value of the given number.

JavaScript Math round() method example

Here, we will understand round() method through various examples.

Example 1

Let's see an example to increases the given number up to the closest integer value.

Test it Now



Example 2

In this example, we will use round() method with negative numbers.

Test it Now



Example 3

Here, you can test round() method with your own test cases.

Test it Now
Next TopicJavaScript Math

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA