JavaScript | Math.round( ) function

The Math.round() function in JavaScript is used to round the number passed as parameter to its nearest integer.

Syntax

Math.round(value)

 

Example


var round =Math.round(9.6)
document.write(``Number after rounding : `` + round)

 

Result

Number after rounding : 10

8-August 12:47 PM 508 Views

 Prev question

Next question