JavaScript Reference/Javascript Methods/round

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

"round()" Example

   <source lang="javascript">
   

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


     </source>
   
  


"round()" is applied to

   <source lang="javascript">

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

     </source>
   
  


"round()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Rounds the specified number to the nearest integer value.

Syntax:

Math.round(param1) Parameters:

   param1   Required; the number to convert.
   
     
     </source>