Return the exchange rate for the provided currency code.

@param  string  $code
@return float
@throws \Exception
431327
public function get($code)
    {
        $rates = $this->getRates();

        $code = strtoupper($code);

        if (empty($rates[$code])) {
            throw new Exception;
        }

        return $rates[$code];
    }
48090
public function getCurrencyCode($sCurrencyCode)
    {
        $obCurrency = $this->obCurrencyList->where('code', $sCurrencyCode)->first();
        if (empty($obCurrency)) {
            return null;
        }

        return $obCurrency->code;
    }
976133
public function getFor(Currency $currency): float
    {
        if ($currency->equals($this->baseCurrency)) {
            // no need to make an api call for same currencies.
            $this->exchangeRates[$currency->getCode()] = (float) 1;
        } else {
            $this->retrieveExchangeRateFor($currency);
        }

        return $this->exchangeRates[$currency->getCode()];
    }
488003
protected function updateCurrency($code)
    {
        if (!$this->isError() && !$this->currency->update($code, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
934800
private function getCurrencyCode($currency)
    {
        $list = self::getCurrencyList();

        if (isset($list[$currency])) {
            return $list[$currency]['code'];
        }

        throw new \RuntimeException('Invalid exception provided');
    }
823482
public function getCurrencyCode($currency = null)
    {
        if ($currency === null) {
            $currency = $this->_currency;
        }

        $code = KlarnaCurrency::getCode($currency);
        return (string) $code;
    }
1331864
public static function isValidCode($code)
    {
        if (array_key_exists($code, self::getInfoForCurrencies())) {
            return true;
        } elseif (array_key_exists($code, self::getInfoForCurrenciesWithoutCurrencyCode())) {
            return true;
        } elseif (array_key_exists($code, self::getInfoForCurrenciesWithUnofficialCode())) {
            return true;
        } elseif (array_key_exists($code, self::getInfoForCurrenciesWithHistoricalCode())) {
            return true;
        } else {
            return false;
        }
    }
1095359
public static function getCurrencySymbol($isocode) {
		return empty(self::$currencySymbols[$isocode])?$isocode:self::$currencySymbols[$isocode];
	}
287473
public function isActive($code)
    {
        return $code && (bool) Arr::get($this->getCurrency($code), 'active', false);
    }
961610
public function getByIsoCode($sCode)
    {
        if (array_key_exists($sCode, $this->aSupportedCurrencies)) {
            return $this->aSupportedCurrencies[$sCode];
        } else {
            throw new CurrencyException('"' . $sCode . '" is not a valid currency code.');
        }
    }
285629
public function getScalePriceForCurrency($currency = 'EUR')
    {
        $scalePrice = null;
        $prices = $this->entity->getPrices();
        if ($prices) {
            foreach ($prices as $price) {
                if ($price->getCurrency()->getCode() == $currency) {
                    $scalePrice[] = $price;
                }
            }
        }

        return $scalePrice;
    }
1165822
public function getTransactionsByCode($code)
    {
        $this->_library->setEnvironment();
        $this->_library->setCharset();
        $this->_library->setLog();

        $response = null;
        try {
            $response = \PagSeguro\Services\Transactions\Search\Code::search(
                $this->_library->getPagSeguroCredentials(),
                $code
            );

            return $response;
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }
    }
1055542
public static String validate(String code) {
        try {
            toCurrency(code);
        } catch (IllegalArgumentException ex) {
            throw new InvalidValueException(code, "currency");
        }
        return code;
    }
21813
private CurrencyData getCurrencyData(String code) {
    CurrencyData data = currencies.get(code);
    if (data == null) {
      data = new CurrencyData();
      data.setCode(code);
      currencies.put(code, data);
    }
    return data;
  }
425026
public static function getDetails($code)
    {
        $infos = self::getInfoForCurrencies();
        if (array_key_exists($code, $infos)) {
            return $infos[$code];
        }
        $infos = self::getInfoForCurrenciesWithoutCurrencyCode();
        if (array_key_exists($code, $infos)) {
            return $infos[$code];
        }
        $infos = self::getInfoForCurrenciesWithUnofficialCode();
        if (array_key_exists($code, $infos)) {
            return $infos[$code];
        }
        $infos = self::getInfoForCurrenciesWithHistoricalCode();
        if (array_key_exists($code, $infos)) {
            return $infos[$code];
        }
        throw new \InvalidArgumentException('Unknown \$code: ' . $code);
    }
946077
protected function resolveCode($code)
    {
        try {
            $value = $this->getApplication()->execute($code, true);
        } catch (\Exception $e) {
            // Swallow all exceptions?
        }

        if (!isset($value) || $value instanceof NoReturnValue) {
            throw new RuntimeException('Unknown target: ' . $code);
        }

        return $value;
    }
882490
public function findByCode($code)
    {
        try {
            $qb = $this->createQueryBuilder('currency')
                ->andWhere('currency.code = :currencyCode')
                ->setParameter('currencyCode', $code);

            return $qb->getQuery()->getSingleResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }