CodesJava

Easy learning with example program codes

JavaScript math round() method

The JavaScript math round() method is used to get the closest integer value of a number.
Syntax:

Math.round(n)

Parameters
n: It represents the number whose closest integer value have to be get.

Returns
Closest integer value of a number.

Example

<!DOCTYPE html>
<html>
<body>
<script>  
document.writeln(Math.round(45.7864));  
</script>  
</body>
</html>

Output

46
Please follow and like us:
error








Copyright © 2019 CodesJava DMCA.com Protection Status