src/Domain/Value/Money/Money.php
public function multiply($multiplier, ?RoundingMode $mode = null): Money
    {
        if ($mode === null) {
            $mode = RoundingMode::HALF_UP();
        }

        $this->guardOperand($multiplier);

        $amount = round($this->amount * $multiplier, 0, $mode->value());
        $amount = $this->castToInteger($amount);

        return $this->withAmount($amount);
    }
public function multiply($multiplier, ?RoundingMode $mode = null): Money
    {
        if ($mode === null) {
            $mode = RoundingMode::HALF_UP();
        }

        $this->guardOperand($multiplier);

        $amount = round($this->amount * $multiplier, 0, $mode->value());
        $amount = $this->castToInteger($amount);

        return $this->withAmount($amount);
    }
public function multiply ( $ multiplier , ? RoundingMode $ mode = null ) : Money { if ( $ mode === null ) { $ mode = RoundingMode :: HALF_UP ( ) ; } $ this -> guardOperand ( $ multiplier ) ; $ amount = round ( $ this -> amount * $ multiplier , 0 , $ mode -> value ( ) ) ; $ amount = $ this -> castToInteger ( $ amount ) ; return $ this -> withAmount ( $ amount ) ; }
Creates instance that multiplies this value by the given value

@param int|float         $multiplier The multiplier
@param RoundingMode|null $mode       The rounding mode; null for HALF_UP

@return Money

@throws DomainException When multiplier is not an int or float
@throws RangeException When integer overflow occurs
Creates instance that multiplies this value by the given value