JavaScript Reference/Javascript Methods/round

Материал из Web эксперт
Перейти к: навигация, поиск

"round()" Example

    
<html>
<body>
<button onclick="alert(Math.round(1.33));">ROUND</button>
</body>
</html>



"round()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |Math                                                          |
+----------------+--------------------------------------------------------------+



"round()" Syntax, Parameters and Note

Note:
Rounds the specified number to the nearest integer value.
    
Syntax:
    
Math.round(param1)
Parameters:
    param1   Required; the number to convert.