Get the currency Symbol
347024
def get_currency_symbol(self):
        
        locale = locales.getLocale('en')
        setup = api.get_setup()
        currency = setup.getCurrency()
        return locale.numbers.currencies[currency].symbol
765967
def get_symbols(self, name):
        
        url = "http://autoc.finance.yahoo.com/autoc?query={0}&callback=YAHOO.Finance.SymbolSuggest.ssCallback".format(name)

        response = requests.get(url)

        json_data = re.match("YAHOO\.Finance\.SymbolSuggest.ssCallback\((.*)\)", response.text)
        try:
            json_data = json_data.groups()[0]
        except (Exception,) as e:
            print(e)
            json_data = '{"results": "Webservice seems to be down"}'

        return type('response', (requests.Response,),{
            'text' : json_data,
            'content': json_data.encode(),
            'status_code': response.status_code,
            'reason': response.reason,
            'encoding': response.encoding,
            'apparent_encoding': response.apparent_encoding,
            'cookies': response.cookies,
            'headers': response.headers,
            'json': lambda : json.loads(json_data),
            'url': response.url
        })
358324
public function getCurrencySign($currency = false)
    {
        $locale = \Locale::getDefault();

        $format = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
        $pattern = $format->formatCurrency('123', $currency);

        preg_match('/^([^\s\xc2\xa0]*)[\s\xc2\xa0]*123(?:[,.]0+)?[\s\xc2\xa0]*([^\s\xc2\xa0]*)$/u', $pattern, $matches);

        if (!empty($matches[1])) {
            $currency_sign = $matches[1];
        } elseif (!empty($matches[2])) {
            $currency_sign = $matches[2];
        } else {
            $currency_sign = '¤';
        }

        return $currency_sign;
    }
1095813
public static function getLoacleconv() {
        if (setlocale(LC_MONETARY, \Yii::$app->language)) {
            $arr = localeconv();

            //\Yii::error($arr['currency_symbol'] . setlocale(LC_MONETARY,0). '    ' . bin2hex($arr['mon_thousands_sep']));

            $arr['currency_symbol'] = iconv("Windows-1252", "UTF-8", $arr['currency_symbol']);
            $arr['mon_thousands_sep'] = iconv("Windows-1252", "UTF-8", $arr['mon_thousands_sep']);
            return $arr;
        } else {
            throw new \yii\base\Exception('Cannot set locale ' . \Yii::$app->language . '. Maybe the local is not installed. See php manual for further information');
        }
    }
1072616
public static CurrencyUnit getCurrency(CurrencyQuery query) {
        return Optional.ofNullable(MONETARY_CURRENCIES_SINGLETON_SPI()).orElseThrow(
                () -> new MonetaryException("No MonetaryCurrenciesSingletonSpi loaded, check your system setup."))
                .getCurrency(query);
    }
481682
def get_currency_symbols(self) -> List[str]:
        
        result = []
        currencies = self.currencies.get_book_currencies()
        for cur in currencies:
            result.append(cur.mnemonic)
        return result
922574
def first_currency():
    
    ct = CurrencyType.objects.filter(code='PES').first()
    if ct:
        return ct.pk
884620
def currency=(currency)
      validator = EnumAttributeValidator.new('String', ["UNKNOWN_CURRENCY", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC"])
      unless validator.valid?(currency)
        fail ArgumentError, "invalid value for 'currency', must be one of #{validator.allowable_values}."
      end
      @currency = currency
    end
338676
public static String formatCurrency(ITemplate template, Object data, String currencyCode) {
        return formatCurrency(template, data, currencyCode, null);
    }
805568
protected static function getPattern($currency)
    {
        if (!$currency) {
            return '{{ widget }}';
        }

        $locale = \Locale::getDefault();

        if (!isset(self::$patterns[$locale])) {
            self::$patterns[$locale] = [];
        }

        if (!isset(self::$patterns[$locale][$currency])) {
            $format = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
            $pattern = $format->formatCurrency('123', $currency);

            // the spacings between currency symbol and number are ignored, because
            // a single space leads to better readability in combination with input
            // fields

            // the regex also considers non-break spaces (0xC2 or 0xA0 in UTF-8)

            preg_match('/^([^\s\xc2\xa0]*)[\s\xc2\xa0]*123(?:[,.]0+)?[\s\xc2\xa0]*([^\s\xc2\xa0]*)$/u', $pattern, $matches);

            if (!empty($matches[1])) {
                self::$patterns[$locale][$currency] = $matches[1].' {{ widget }}';
            } elseif (!empty($matches[2])) {
                self::$patterns[$locale][$currency] = '{{ widget }} '.$matches[2];
            } else {
                self::$patterns[$locale][$currency] = '{{ widget }}';
            }
        }

        return self::$patterns[$locale][$currency];
    }
13024
public static String formatCurrency(Object data, String currencyCode, Locale locale) {
        return formatCurrency(null, data, currencyCode, locale);
    }
518945
@Api
	public void getValue(String name, CurrencyAttribute attribute) {
		attribute.setValue((String) formWidget.getValue(name));
	}
505055
def get_info(self, code):
        """"""
        for i, currency in enumerate(self.get_currency(code)):
            if i == 0:
                try:
                    exp = int(currency.find('CcyMnrUnts').text)
                except ValueError:
                    exp = 0
                info = {
                    'CountryNames': [],
                    'ISO4217Number': int(currency.find('CcyNbr').text),
                    'ISO4217Exponent': exp,
                    'ISOUpdate': self.published.isoformat(),
                }
            try:
                ctry_name = currency.find('CtryNm').text
            except AttributeError:
                continue
            if ctry_name:
                info['CountryNames'] += [ctry_name]
        return info
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;
        }
    }
522643
public CurrencyUnit getCurrency(CurrencyQuery query) {
        Set<CurrencyUnit> currencies = getCurrencies(query);
        if (currencies.isEmpty()) {
            return null;
        }
        if (currencies.size() == 1) {
            return currencies.iterator().next();
        }
        throw new MonetaryException("Ambiguous request for CurrencyUnit: " + query + ", found: " + currencies);
    }
1367875
def get_currencysymbol(self, code):
        """"""
        if not self._symbols:
            symbolpath = os.path.join(self._dir, 'currencies.json')
            with open(symbolpath, encoding='utf8') as df:
                self._symbols = json.load(df)
        return self._symbols.get(code)
432084
public function getFormattedPrice($price, $symbol = 'EUR', $locale = 'de')
    {
        return $this->priceFormatter->format(
            (float) $price,
            null,
            $locale,
            $symbol,
            PriceFormatter::CURRENCY_LOCATION_SUFFIX
        );
    }