public function round(int $precision = 0, ?RoundingMode $roundingMode = null): FloatObject
    {
        if ($roundingMode === null) {
            $roundingMode = RoundingMode::HALF_UP();
        }

        return new static((float) round($this->value, $precision, $roundingMode->value()));
    }
public function round(int $precision = 0, ?RoundingMode $roundingMode = null): FloatObject
    {
        if ($roundingMode === null) {
            $roundingMode = RoundingMode::HALF_UP();
        }

        return new static((float) round($this->value, $precision, $roundingMode->value()));
    }
public function round ( int $ precision = 0 , ? RoundingMode $ roundingMode = null ) : FloatObject { if ( $ roundingMode === null ) { $ roundingMode = RoundingMode :: HALF_UP ( ) ; } return new static ( ( float ) round ( $ this -> value , $ precision , $ roundingMode -> value ( ) ) ) ; }
Creates a float that represents the rounded value

@param int               $precision    The number of digits to round to
@param RoundingMode|null $roundingMode The rounding mode

@return FloatObject
Creates a float that represents the rounded value