Returns an array with keys "digits" and "rounding", each an integer.

@param string $currencyCode
@return array ['digits' => int, 'rounding => int]
494725
public function getFraction($currencyCode)
    {
        if (array_key_exists($currencyCode, $this->fractions)) {
            return $this->fractions[$currencyCode];
        }

        return $this->fractions['DEFAULT'];
    }
866095
public static function getStoreAmountOfCurrency($amount, $currencyCode) {
        $currencyCode   = strtoupper($currencyCode);
        $amount         = (int) $amount;

        if( in_array($currencyCode, self::FULL_VALUE_CURRENCIES, true) ) {
            return (float) $amount;
        }

        if( in_array($currencyCode, self::DIV_1000_VALUE_CURRENCIES, true) ) {
            return (float) ($amount / self::DIV_1000);
        }

        return (float) ($amount / self::DIV_100);
    }
186608
protected function checksum($code)
	{
		$chars = [
			'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
			'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
			'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
			'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%',
			'<', '=', '>', '?'
		];

		// translate special characters
		$code = strtr($code, chr(128) . chr(131) . chr(129) . chr(130), '<=>?');
		$len = strlen($code);

		// calculate check digit C
		$p = 1;
		$check = 0;
		for ($i = ($len - 1); $i >= 0; --$i) {
			$k = array_keys($chars, $code{$i});
			$check += ($k[0] * $p);
			++$p;
			if ($p > 20) {
				$p = 1;
			}
		}
		$check %= 47;
		$c = $chars[$check];
		$code .= $c;

		// calculate check digit K
		$p = 1;
		$check = 0;
		for ($i = $len; $i >= 0; --$i) {
			$k = array_keys($chars, $code{$i});
			$check += ($k[0] * $p);
			++$p;
			if ($p > 15) {
				$p = 1;
			}
		}
		$check %= 47;
		$k = $chars[$check];
		$checksum = $c . $k;

		// resto respecial characters
		$checksum = strtr($checksum, '<=>?', chr(128) . chr(131) . chr(129) . chr(130));

		return $checksum;
	}
923757
public static function getCurrencyCode()
	{
		if (!isset(self::$_currencyCode)) {
			$localeconv = localeconv();
			self::$_currencyCode = ($localeconv['currency_symbol'] != '')
				? $localeconv['currency_symbol'] : $localeconv['int_curr_symbol'];

			if (self::$_currencyCode == '') {
				// Default to $
				self::$_currencyCode = '$';
			}
		}
		return self::$_currencyCode;
	}
1002439
private function getCurrencySymbol(string $currencyCode, string $locale): string
    {
        $formatter = new NumberFormatter($locale.'@currency='.$currencyCode, NumberFormatter::CURRENCY);

        return $formatter->getSymbol(NumberFormatter::CURRENCY_SYMBOL);
    }
1301994
public function getCurrency($currencyCode) : Currency
    {
        if (isset($this->currencies[$currencyCode])) {
            return $this->currencies[$currencyCode];
        }

        if (! isset($this->currencyData[$currencyCode])) {
            if ($this->numericToCurrency === null) {
                $this->numericToCurrency = require __DIR__ . '/../data/numeric-to-currency.php';
            }

            if (isset($this->numericToCurrency[$currencyCode])) {
                return $this->getCurrency($this->numericToCurrency[$currencyCode]);
            }

            throw UnknownCurrencyException::unknownCurrency($currencyCode);
        }

        $currency = new Currency(... $this->currencyData[$currencyCode]);

        return $this->currencies[$currencyCode] = $currency;
    }
360544
public static Currency getInstance(String currencyCode) {
        synchronized (codesToCurrencies) {
            Currency currency = codesToCurrencies.get(currencyCode);
            if (currency == null) {
                currency = new Currency(currencyCode);
                codesToCurrencies.put(currencyCode, currency);
            }
            return currency;
        }
    }
823482
public function getCurrencyCode($currency = null)
    {
        if ($currency === null) {
            $currency = $this->_currency;
        }

        $code = KlarnaCurrency::getCode($currency);
        return (string) $code;
    }
442429
public static function currencySymbol($code = null)
    {
        $localeCode = \Locale::getDefault();
        if ($code !== null) {
            $localeCode .= '@currency=' . $code;
        }
        $formatter = new \NumberFormatter($localeCode, \NumberFormatter::CURRENCY);
        $symbol = $formatter->getSymbol(\NumberFormatter::CURRENCY_SYMBOL);
        return $symbol != $code
            ? $symbol
            : (static::countryCurrencySymbol(substr($code, 0, 2))
                ?: $symbol);
    }
1058241
public function getByCode($code)
    {
        foreach ($this->currencies as $currency) {
            if (0 === strcasecmp($code, $currency['alpha3']) ||
                0 === strcasecmp($code, $currency['numeric'])) {
                return $currency;
            }
        }

        throw new \OutOfBoundsException('ISO 4217 does not contain: '.$code);
    }
651454
public function format($amount, $currency_code, $decimal = true, $full = true)
    {
        $currency = $this->currency->get($currency_code);

        if (empty($currency)) {
            return 'n/a';
        }

        if ($decimal) {
            $amount = $this->decimal($amount, $currency_code);
        }

        // Pass the amount to the currency template as %price variable
        $currency['price'] = $this->formatNumber($amount, $currency);

        if ($full) {
            return $this->formatTemplate($amount, $currency);
        }

        return $amount < 0 ? '-' . $currency['price'] : $currency['price'];
    }
1326688
public function getCurrencyArray($currency = null)
    {
        $confCurrencies = $this->getConfigParam('aCurrencies');
        if (!is_array($confCurrencies)) {
            return [];
        }

        // processing currency configuration data
        $currencies = [];
        reset($confCurrencies);
        foreach ($confCurrencies as $key => $val) {
            if ($val) {
                $cur = new stdClass();
                $cur->id = $key;
                $curValues = explode('@', $val);
                $cur->name = trim($curValues[0]);
                $cur->rate = trim($curValues[1]);
                $cur->dec = trim($curValues[2]);
                $cur->thousand = trim($curValues[3]);
                $cur->sign = trim($curValues[4]);
                $cur->decimal = trim($curValues[5]);

                // change for US version
                if (isset($curValues[6])) {
                    $cur->side = trim($curValues[6]);
                }

                if (isset($currency) && $key == $currency) {
                    $cur->selected = 1;
                } else {
                    $cur->selected = 0;
                }
                $currencies[$key] = $cur;
            }

            // #861C -  performance, do not load other currencies
            if (!$this->getConfigParam('bl_perfLoadCurrency')) {
                break;
            }
        }

        return $currencies;
    }
689781
function fetchCurrency( $code )
    {
        $currency = eZCurrencyData::fetch( $code );
        if ( is_object( $currency ) )
            $result = array( 'result' => $currency );
        else
            $result = array( 'result' => false );

        return $result;
    }
1204964
public function decimal($amount, $currency_code)
    {
        static $divisors = array();

        if (empty($divisors[$currency_code])) {
            $currency = $this->currency->get($currency_code);
            $divisors[$currency_code] = pow(10, $currency['decimals']);
        }

        return $amount / $divisors[$currency_code];
    }
124177
public function getValues(array $digits)
    {
        $values = [];

        foreach ($digits as $digit) {
            $values[] = $this->digits->getValue($digit);
        }

        return $values;
    }
1170206
public function getCurrencies()
    {
        $response = $this->sendRequest(
            $this->serviceBaseUrl . 'GetCurrencies',
            ['MerchantLogin' => $this->auth->getMerchantLogin(), 'Language' => $this->culture],
            $this->requestMethod
        );

        $sxe = simplexml_load_string($response);
        $this->parseError($sxe);

        if (!$sxe->Groups->Group) {
            return [];
        }
        $groups = [];
        foreach ($sxe->Groups->Group as $i => $group) {
            $items = [];
            foreach ($group->Items->Currency as $item) {
                $item = (array)$item;
                $items[] = $item['@attributes'];
            }
            $groups[] = [
                'Code'        => (string)$group->attributes()->Code,
                'Description' => (string)$group->attributes()->Description,
                'Items'       => $items,
            ];
        }
        return $groups;
    }
670035
public static function getCurrency($countryCode)
    {
        if (!array_key_exists($countryCode, self::$currencies)) {
            throw new Exception\InvalidArgumentException(sprintf('Unsupported Country Code, %s', $countryCode));
        }

        return self::$currencies[$countryCode];
    }