php8.5
Home/ Manual/ com / functions/ variant_round

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

value

The variant.

decimals

Number of decimal places.

Variant-arith

Return Values

Returns the rounded value, or null on failure.

See Also

Source: reference/com/functions/variant-round.xml · from the official PHP manual (php/doc-en)