variant_round
PHP function
Edit on GitHub ✎
(PHP 5, PHP 7, PHP 8)
Rounds a variant to the specified number of decimal places
Description
variant_round(mixed $value, int $decimals): variant|null
Returns the value of value rounded to decimals decimal places.
Parameters
valueThe variant.
decimalsNumber of decimal places.
Variant-arith
Return Values
Returns the rounded value, or null on failure.