JavaScript Math.round() Method

You are Here:

JavaScript Math.round() Method

The Math.round() method returns the value of a number rounded to the nearest integer.


HTML Online Editor
<!DOCTYPE html> <html> <body> <script> var result = Math.round(6.4); document.write(result); </script> </body> </html>



Parameter Values

xRequiredSpecifies a number.

Return Value

NumberThe value of the given number rounded to the nearest integer.

More Examples


HTML Online Editor
Math.round(null); // 0 Math.round(-6.6); // -7 Math.round(-6.5); // -6 Math.round(-6.4); // -6 Math.round(6); // 6 Math.round(6.4); // 6 Math.round(6.5); // 7 Math.round(6.6); // 7


Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in JavaScript.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author