floor()
14th January 2021
0 Comments
Programming Language
PHP [Versions: 4, 5, 7]
Syntax
Typical Usage
Rounds fractions down to the nearest whole number.
Accepted Parameters
- value (float) (Required): The float value you wish to round down.
Return Value(s)
Returns a value rounded down to the next highest integer.Notes
The return value of floor() is still of type float.
Examples of floor()
Example 1
<?php
$floor = ceil(2.1234);
print_r($floor)
// Output = 2
The above output will be 2.
Example 2
<?php
$floor= ceil(68.7654);
print_r($floor)
// Output = 68
The above output will be 68.
Similar Functions in Other Languages
- Javascript: Math.floor()
Was This Helpful?
If this post has helped you, please let me know. Your feedback will be highly appreciated and will help me build better content.