Math.floor
Math.floor
Function
Round down. Returns the largest integer less than or equal to value.
Syntax
Math.floor(value)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| value | Number | Yes | None | The number that participates in rounding. |
Return value
| Type | Description |
|---|---|
| Int/Float | Returns the largest integer less than or equal to value. An Int is returned for integer results, and a Float for non-integer or non-finite results. |
Example
result = Math.floor(1.8) // Output: 1 print result
Notes
- Integer results return Int.