public function sub($quantity, $unit = null)
    {
        if ($unit === null) {
            $unit = $this->unit;
        }

        $quantity = new static($quantity, $unit, $this->currencyData);
        /** @var Currency $quantity */
        $quantity->to($this->unit);
        $this->value -= $quantity->getValue();
        return $this;
    }
public function sub($quantity, $unit = null)
    {
        if ($unit === null) {
            $unit = $this->unit;
        }

        $quantity = new static($quantity, $unit, $this->currencyData);
        /** @var Currency $quantity */
        $quantity->to($this->unit);
        $this->value -= $quantity->getValue();
        return $this;
    }
public function sub ( $ quantity , $ unit = null ) { if ( $ unit === null ) { $ unit = $ this -> unit ; } $ quantity = new static ( $ quantity , $ unit , $ this -> currencyData ) ; /** @var Currency $quantity */ $ quantity -> to ( $ this -> unit ) ; $ this -> value -= $ quantity -> getValue ( ) ; return $ this ; }
Subtracts a quantity from this quantity,
@param float $quantity value to subtract
@param string $unit quantity unit
@return Currency this quantity
Subtracts a quantity from this quantity