From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Math Object
The floor() method returns the value of a number rounded DOWNWARDS to the nearest integer.
| Math.floor(x) |
| Parameter | Description |
|---|---|
| x | Required. A number |
ExampleUse the floor() method on different numbers:
The output of the code above will be:
Try it yourself » |
JavaScript Math Object
From http://www.w3schools.com (Copyright Refsnes Data)