JavaScript Reference/Javascript Methods/floor

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

"floor()" Example

   <source lang="javascript">
   

<html> <body> <button onclick="alert(Math.floor(1.1));">FLOOR</button> </body> </html>


     </source>
   
  


"floor()" is applied to

   <source lang="javascript">

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

     </source>
   
  


"floor()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Rounds the number down to the nearest integer.

Syntax:

Math.floor(param1) Parameters:

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