PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular

floor

Tags: PHP 5.x PHP 7.x PHP 8.x

floor — Round fractions down.

Description

floor(
    int|float $num
): float
Returns the next lowest integer value (as float) by rounding down num if necessary.

Parameters

num
The value to round

Return Values

num rounded to the next lowest integer. The return value of floor() is still of type float because the value range of float is usually bigger than that of int. This function returns false in case of an error (e.g. passing an array).

floor - New snippets