Returns a currency by it's ISO 4217 code
@param  string $sCode The currency to get
@return \stdClass
@throws CurrencyException
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.');
        }
    }
731060
private Currency getCurrency(String currencyCode) {
        try {
            return Currency.getInstance(currencyCode);
        } catch (Exception e) {
            return null;
        }
    }
914578
public function numericCodeFor(Currency $currency)
    {
        if (!$this->contains($currency)) {
            throw new UnknownCurrencyException('Cannot find ISO currency '.$currency->getCode());
        }

        return $this->getCurrencies()[$currency->getCode()]['numericCode'];
    }
346324
public static function getTimezoneFromCode($sCode)
    {
        $aAbbreviations = \DateTimeZone::listAbbreviations();
        foreach ($aAbbreviations as $sTzCode => $aValues) {
            if (strtolower($sCode) == $sTzCode) {
                $aTimeZone = reset($aValues);
                return getFromArray('timezone_id', $aTimeZone, false);
            }
        }

        return false;
    }
1105190
public static function countryLocaleCode($countryCode)
    {
        $countryLocaleCodes = static::countryLocaleCodes($countryCode);
        if ($languageCode = Language::countryLanguageCode($countryCode)) {
            $languageLocaleCodes = static::languageLocaleCodes($languageCode);
            if ($localeCodes = array_intersect($languageLocaleCodes, $countryLocaleCodes)) {
                return reset($localeCodes);
            } elseif ($countryLocaleCodes) {
                return reset($countryLocaleCodes);
            } elseif ($languageLocaleCodes) {
                return reset($languageLocaleCodes);
            }

            return \Locale::composeLocale([
                'language' => $languageCode,
                'region' => $countryCode,
            ]);
        }

        if (!count($countryLocaleCodes)) {
            return null;
        } elseif (count($countryLocaleCodes) == 1) {
            return reset($countryLocaleCodes);
        }

        if ($localeCode = static::findMainCode($countryLocaleCodes)) {
            return $localeCode;
        }

        foreach ($countryLocaleCodes as $localeCode) {
            $languageCode = static::languageCode($localeCode);
            if (!strcasecmp($languageCode, $countryCode)) {
                return $localeCode;
            }
        }

        return reset($countryLocaleCodes);
    }
1049409
protected function getCurrencyCodeAttribute()
    {
        if (empty($this->sActiveCurrency)) {
            return CurrencyHelper::instance()->getActiveCurrencyCode();
        }

        $sResult = CurrencyHelper::instance()->getCurrencyCode($this->sActiveCurrency);
        $this->sActiveCurrency = null;

        return $sResult;
    }
102978
public static function getISO4217CurrencyCode($currency) {
    return (array_key_exists($currency, Connect2PayCurrencyHelper::$currencies)) ? Connect2PayCurrencyHelper::$currencies[$currency]["code"] : null;
  }
1354563
public static function getValue($sCode, $sDefaultValue = null)
    {
        if (empty($sCode)) {
            return $sDefaultValue;
        }

        //Get settings object
        $obSettings = static::where('item', static::SETTINGS_CODE)->first();
        if (empty($obSettings)) {
            return static::get($sCode, $sDefaultValue);
        }

        $sValue = $obSettings->$sCode;
        if (empty($sValue)) {
            return $sDefaultValue;
        }

        return $sValue;
    }
519516
function getISOCurrency($curr) {
    $out = "";
    if(ctype_digit($curr) || is_int($curr)) {
      $numCurr = $curr + 0;
      if($numCurr < 10) {
        $out = "00" . $numCurr;
      } else if ($numCurr < 100) {
        $out = "0" . $numCurr;
      } else {
        //Assume 3 digits (if greater let MAPs handle error)
        $out = "" . $numCurr;
      }
    } else {
      // Convert char to digit
      $curCode = Array();
      $curCode["AUD"]="036";
      $curCode["CAD"]="124";
      $curCode["CHF"]="756";
      $curCode["CZK"]="203";
      $curCode["DKK"]="208";
      $curCode["EUR"]="978";
      $curCode["GBP"]="826";
      $curCode["HUF"]="348";
      $curCode["JPY"]="392";
      $curCode["NOK"]="578";
      $curCode["NZD"]="554";
      $curCode["PLN"]="985";
      $curCode["SEK"]="752";
      $curCode["SGD"]="702";
      $curCode["USD"]="840";
      $out = $curCode[$curr];
    }

    return $out;
  }
938231
public function getPaylikeMultiplier( $currency_iso_code ) {
		$currency = $this->getCurrency( $currency_iso_code );
		if ( isset( $currency['exponent'] ) ) {
			return pow( 10, $currency['exponent'] );
		} else {
			return pow( 10, 2 );
		}
	}
998798
public function getCurrency($iso)
    {
        if ($this->currencies === null && $this->config('include_currency', false)) {
            $this->currencies = include(__DIR__ . '/Support/Currencies.php');
        }

        return Arr::get($this->currencies, $iso);
    }
1329257
public static function getCurrencyBundle()
    {
        @trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.3, use "%s" instead.', __METHOD__, Currencies::class), E_USER_DEPRECATED);

        if (null === self::$currencyBundle) {
            self::$currencyBundle = new CurrencyBundle(
                self::getDataDirectory().'/'.self::CURRENCY_DIR,
                self::getEntryReader(),
                self::$localeBundle ?? self::$localeBundle = new LocaleBundle(self::getDataDirectory().'/'.self::LOCALE_DIR, self::getEntryReader())
            );
        }

        return self::$currencyBundle;
    }
969548
public function setCurrencyCode($currencyCode): self
    {
        if ($currencyCode instanceof RowColumn) {
            $this->currency_column = $currencyCode->getColumnName();
        } elseif (!is_string($currencyCode) || trim($currencyCode) === '') {
            throw new Exception\InvalidArgumentException(__METHOD__ . ' Currency code must be an non empty string (or a RowColumn object)');
        }
        $this->params['currency_code'] = $currencyCode;

        return $this;
    }
306984
public function getIso($code = null)
    {
        $data = (array) gplcart_config_get(GC_FILE_CONFIG_CURRENCY);

        if (isset($code)) {
            return isset($data[$code]) ? $data[$code] + array('code' => $code) : array();
        }

        return $data;
    }
339672
private function createCurrency($currencyCode)
    {
        /** @var CurrencyInterface $currency */
        $currency = $this->currencyFactory->createNew();
        $currency->setCode($currencyCode);

        return $currency;
    }
557709
public function getContinentByCode($sCode)
    {
        $aContinents = $this->getAll();

        return ! empty($aContinents[$sCode]) ? $aContinents[$sCode] : false;
    }
793845
public function format($sCode, $nValue, $bIncludeSymbol = true)
    {
        try {

            $oCurrency = $this->getByIsoCode($sCode);
            $sOut      = number_format(
                $nValue,
                $oCurrency->decimal_precision,
                $oCurrency->decimal_symbol,
                $oCurrency->thousands_separator
            );

            if ($bIncludeSymbol) {
                if ($oCurrency->symbol_position == 'BEFORE') {
                    $sOut = $oCurrency->symbol . $sOut;
                } else {
                    $sOut = $sOut . $oCurrency->symbol;
                }
            }

            return $sOut;

        } catch (\Exception $e) {
            return '[CURRENCY FORMATTING FAILED: ' . $e->getMessage() . ']';
        }
    }