php8.5
Home/ Manual/ bc / functions/ bcfloor

bcfloor

PHP function Edit on GitHub ✎

(PHP 8 >= 8.4.0)

Round down arbitrary precision number

Description

bcfloor(string $num): string

Returns the next lowest integer value by rounding down num if necessary.

Return Values

Returns a numeric string representing num rounded down to the nearest integer.

Examples

bcfloor() example

php
<?php
var_dump(bcfloor('4.3'));
var_dump(bcfloor('9.999'));
var_dump(bcfloor('-3.14'));
?>

The above example will output:

output
string(1) "4"
string(1) "9"
string(2) "-4"

See Also

Source: reference/bc/functions/bcfloor.xml · from the official PHP manual (php/doc-en)