src/Money.php
public function quotient($that) : Money
    {
        $that = BigInteger::of($that);
        $step = $this->context->getStep();

        $scale  = $this->amount->getScale();
        $amount = $this->amount->withPointMovedRight($scale)->dividedBy($step);

        $q = $amount->quotient($that);
        $q = $q->multipliedBy($step)->withPointMovedLeft($scale);

        return new Money($q, $this->currency, $this->context);
    }
public function quotient($that) : Money
    {
        $that = BigInteger::of($that);
        $step = $this->context->getStep();

        $scale  = $this->amount->getScale();
        $amount = $this->amount->withPointMovedRight($scale)->dividedBy($step);

        $q = $amount->quotient($that);
        $q = $q->multipliedBy($step)->withPointMovedLeft($scale);

        return new Money($q, $this->currency, $this->context);
    }
public function quotient ( $ that ) : Money { $ that = BigInteger :: of ( $ that ) ; $ step = $ this -> context -> getStep ( ) ; $ scale = $ this -> amount -> getScale ( ) ; $ amount = $ this -> amount -> withPointMovedRight ( $ scale ) -> dividedBy ( $ step ) ; $ q = $ amount -> quotient ( $ that ) ; $ q = $ q -> multipliedBy ( $ step ) -> withPointMovedLeft ( $ scale ) ; return new Money ( $ q , $ this -> currency , $ this -> context ) ; }
Returns the quotient of the division of this Money by the given number.

The given number must be a integer value. The resulting Money has the same context as this Money.
This method can serve as a basis for a money allocation algorithm.

@param BigNumber|number|string $that The divisor. Must be convertible to a BigInteger.

@return Money

@throws MathException If the divisor cannot be converted to a BigInteger.
Returns the quotient of the division of this Money by the given number .