floor()
Anonymous contributor
Anonymous contributor1 total contribution
Anonymous contributor
Published May 26, 2023
Contribute to Docs
The floor()
function returns a rounded number down to the nearest integer.
The result returns a value type of float
.
Syntax
$result = floor(n);
Where n
is the number to be rounded down to the nearest integer.
Example
floor(3.4)// Output: 3
The result will be a float value of 3
as the function rounds 3.4
down to 3
.
Codebyte Example
Using floor()
to return the value of 5 after rounding down`:
All contributors
- Anonymous contributorAnonymous contributor1 total contribution
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.