public function printConvertMoney(
        MoneyInterface $money = null,
        CurrencyInterface $targetCurrency = null
    ) {
        if (!($money instanceof MoneyInterface)) {
            return '';
        }

        if (!($targetCurrency instanceof CurrencyInterface)) {
            $targetCurrency = $this
                ->currencyWrapper
                ->get();
        }

        /**
         * @var CurrencyInterface $targetCurrency
         */
        $moneyConverted = $this
            ->currencyConverter
            ->convertMoney(
                $money,
                $targetCurrency
            );

        return $this->printMoney($moneyConverted);
    }
public function printConvertMoney(
        MoneyInterface $money = null,
        CurrencyInterface $targetCurrency = null
    ) {
        if (!($money instanceof MoneyInterface)) {
            return '';
        }

        if (!($targetCurrency instanceof CurrencyInterface)) {
            $targetCurrency = $this
                ->currencyWrapper
                ->get();
        }

        /**
         * @var CurrencyInterface $targetCurrency
         */
        $moneyConverted = $this
            ->currencyConverter
            ->convertMoney(
                $money,
                $targetCurrency
            );

        return $this->printMoney($moneyConverted);
    }
public function printConvertMoney ( MoneyInterface $ money = null , CurrencyInterface $ targetCurrency = null ) { if ( ! ( $ money instanceof MoneyInterface ) ) { return '' ; } if ( ! ( $ targetCurrency instanceof CurrencyInterface ) ) { $ targetCurrency = $ this -> currencyWrapper -> get ( ) ; } /**
         * @var CurrencyInterface $targetCurrency
         */ $ moneyConverted = $ this -> currencyConverter -> convertMoney ( $ money , $ targetCurrency ) ; return $ this -> printMoney ( $ moneyConverted ) ; }
Return a formatted price given an Money object and the target currency.

If money is null, print empty string

@param MoneyInterface    $money          the Money object to print
@param CurrencyInterface $targetCurrency Iso code of the target currency (optional)

@throws CurrencyNotAvailableException   Any currency available
@throws CurrencyNotConvertibleException Currencies cannot be converted

@return string The formatted price
Return a formatted price given an Money object and the target currency .