Returns currencies used in the book
326265
def get_book_currencies(self) -> List[Commodity]:
        
        query = (
            self.currencies_query
                .order_by(Commodity.mnemonic)
        )
        return query.all()
152794
public static OrderBook adaptOrderbook(
      BitcoiniumOrderbook bitcoiniumOrderbook, CurrencyPair currencyPair) {

    List<LimitOrder> asks =
        createOrders(currencyPair, Order.OrderType.ASK, bitcoiniumOrderbook.getAsks());
    List<LimitOrder> bids =
        createOrders(currencyPair, Order.OrderType.BID, bitcoiniumOrderbook.getBids());
    Date date =
        new Date(
            bitcoiniumOrderbook
                .getBitcoiniumTicker()
                .getTimestamp()); // Note, this is the timestamp of the piggy-backed Ticker.
    return new OrderBook(date, asks, bids);
  }
950048
public static OrderBook adaptOrderBook(
      final RippleOrderBook rippleOrderBook,
      final RippleMarketDataParams params,
      final CurrencyPair currencyPair) {
    final String orderBook =
        rippleOrderBook.getOrderBook(); // e.g. XRP/BTC+rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B
    final String[] splitPair = orderBook.split("/");

    final String[] baseSplit = splitPair[0].split("\\+");
    final String baseSymbol = baseSplit[0];
    if (baseSymbol.equals(currencyPair.base.getCurrencyCode()) == false) {
      throw new IllegalStateException(
          String.format(
              "base symbol in Ripple order book %s does not match requested base %s",
              orderBook, currencyPair));
    }
    final String baseCounterparty;
    if (baseSymbol.equals("XRP")) {
      baseCounterparty = ""; // native currency
    } else {
      baseCounterparty = baseSplit[1];
    }
    if (baseCounterparty.equals(params.getBaseCounterparty()) == false) {
      throw new IllegalStateException(
          String.format(
              "base counterparty in Ripple order book %s does not match requested counterparty %s",
              orderBook, params.getBaseCounterparty()));
    }

    final String[] counterSplit = splitPair[1].split("\\+");
    final String counterSymbol = counterSplit[0];
    if (counterSymbol.equals(currencyPair.counter.getCurrencyCode()) == false) {
      throw new IllegalStateException(
          String.format(
              "counter symbol in Ripple order book %s does not match requested base %s",
              orderBook, currencyPair));
    }
    final String counterCounterparty;
    if (counterSymbol.equals("XRP")) {
      counterCounterparty = ""; // native currency
    } else {
      counterCounterparty = counterSplit[1];
    }
    if (counterCounterparty.equals(params.getCounterCounterparty()) == false) {
      throw new IllegalStateException(
          String.format(
              "counter counterparty in Ripple order book %s does not match requested counterparty %s",
              orderBook, params.getCounterCounterparty()));
    }

    final List<LimitOrder> bids =
        createOrders(
            currencyPair,
            OrderType.BID,
            rippleOrderBook.getBids(),
            baseCounterparty,
            counterCounterparty);
    final List<LimitOrder> asks =
        createOrders(
            currencyPair,
            OrderType.ASK,
            rippleOrderBook.getAsks(),
            baseCounterparty,
            counterCounterparty);
    return new OrderBook(null, asks, bids);
  }
189036
function currencies() {
    global $db;
    $this->currencies = array();
    $currencies_query = "select code, title, symbol_left, symbol_right, decimal_point,
                                  thousands_point, decimal_places, value
                          from " . TABLE_CURRENCIES;

    $currencies = $db->Execute($currencies_query);

    while (!$currencies->EOF) {
      $this->currencies[$currencies->fields['code']] = array('title' => $currencies->fields['title'],
      'symbol_left' => $currencies->fields['symbol_left'],
      'symbol_right' => $currencies->fields['symbol_right'],
      'decimal_point' => $currencies->fields['decimal_point'],
      'thousands_point' => $currencies->fields['thousands_point'],
      'decimal_places' => $currencies->fields['decimal_places'],
      'value' => $currencies->fields['value']);

      $currencies->MoveNext();
    }
  }
225968
private function getCurrencies()
    {
        /** @var Currency[] $currencies */
        $currencies = $this->get('sulu_product.currency_repository')->findBy([],['name'=>'asc']);

        $currencyValues = array();
        foreach ($currencies as $currency) {
            $currencyValues[] = array(
                'id' => $currency->getId(),
                'name' => $currency->getName(),
                'code' => $currency->getCode()
            );
        }

        return $currencyValues;
    }
893057
public static BitfinexOrderBookSymbol orderBook(final BitfinexCurrencyPair currencyPair, 
    		final BitfinexOrderBookSymbol.Precision precision,
    		final BitfinexOrderBookSymbol.Frequency frequency, final int pricePoints) {
    	
        if (precision == BitfinexOrderBookSymbol.Precision.R0) {
            throw new IllegalArgumentException("Use BitfinexSymbols#rawOrderBook() factory method instead");
        }
        
        return new BitfinexOrderBookSymbol(currencyPair, precision, frequency, pricePoints);
    }
285412
def get_currencies(self):
        """"""
        try:
            resp = get(self.endpoint)
            resp.raise_for_status()
        except exceptions.RequestException as e:
            self.log(logging.ERROR, "%s: Problem whilst contacting endpoint:\n%s", self.name, e)
        else:
            with open(self._cached_currency_file, 'wb') as fd:
                fd.write(resp.content)

        try:
            root = ET.parse(self._cached_currency_file).getroot()
        except FileNotFoundError as e:
            raise RuntimeError("%s: XML not found at endpoint or as cached file:\n%s" % (self.name, e))

        return root
1049820
def get_default_currency(self) -> Commodity:
        
        result = None

        if self.default_currency:
            result = self.default_currency
        else:
            def_currency = self.__get_default_currency()
            self.default_currency = def_currency
            result = def_currency

        return result
1069263
public static function data_currencies() {

		// If it's already done, do not redo the filter
		if ( ! empty( static::$currencies ) ) {
			return static::$currencies;
		}

		$default_currencies = array(
			'aud'     => array(
				'label'  => 'AUD',
				'name'   => __( 'Australian Dollar', 'pods' ),
				'sign'   => '$',
				'entity' => '&#36;',
			),
			'brl'     => array(
				'label'  => 'BRL',
				'name'   => __( 'Brazilian Real', 'pods' ),
				'sign'   => 'R$',
				'entity' => 'R&#36;',
			),
			'gbp'     => array(
				'label'  => 'GBP',
				'name'   => __( 'British Pound', 'pods' ),
				'sign'   => '£',
				'entity' => '&pound;',
			),
			'cad'     => array(
				'label'  => 'CAD',
				'name'   => __( 'Canadian Dollar', 'pods' ),
				'sign'   => '$',
				'entity' => '&#36;',
			),
			'cny'     => array(
				'label'  => 'CNY',
				'name'   => __( 'Chinese Yen (¥)', 'pods' ),
				'sign'   => '¥',
				'entity' => '&yen;',
			),
			'cny2'    => array(
				'label'  => 'CNY',
				'name'   => __( 'Chinese Yuan (元)', 'pods' ),
				'sign'   => '元',
				'entity' => '&#20803;',
			),
			'czk'     => array(
				'label'  => 'CZK',
				'name'   => __( 'Czech Koruna', 'pods' ),
				'sign'   => 'Kč',
				'entity' => 'K&#x10D;',
			),
			'dkk'     => array(
				'label'  => 'DKK',
				'name'   => __( 'Danish Krone', 'pods' ),
				'sign'   => 'kr.',
				'entity' => 'kr.',
			),
			'euro'    => array(
				'label'  => 'EUR',
				'name'   => __( 'Euro', 'pods' ),
				'sign'   => '€',
				'entity' => '&euro;',
			),
			'hkd'     => array(
				'label'  => 'HKD',
				'name'   => __( 'Hong Kong Dollar', 'pods' ),
				'sign'   => '$',
				'entity' => '&#36;',
			),
			'huf'     => array(
				'label'  => 'HUF',
				'name'   => __( 'Hungarian Forint', 'pods' ),
				'sign'   => 'Ft',
				'entity' => 'Ft',
			),
			'inr'     => array(
				'label'  => 'INR',
				'name'   => __( 'Indian Rupee', 'pods' ),
				'sign'   => '₹',
				'entity' => '&#x20B9;',
			),
			'idr'     => array(
				'label'  => 'IDR',
				'name'   => __( 'Indonesian Rupiah', 'pods' ),
				'sign'   => 'Rp',
				'entity' => 'Rp',
			),
			'ils'     => array(
				'label'  => 'ILS',
				'name'   => __( 'Israeli New Sheqel', 'pods' ),
				'sign'   => '₪',
				'entity' => '&#x20AA;',
			),
			'jpy'     => array(
				'label'  => 'JPY',
				'name'   => __( 'Japanese Yen', 'pods' ),
				'sign'   => '¥',
				'entity' => '&yen;',
			),
			'krw'     => array(
				'label'  => 'KRW',
				'name'   => __( 'Korean Won', 'pods' ),
				'sign'   => '₩',
				'entity' => '&#8361;',
			),
			'myr'     => array(
				'label'  => 'MYR',
				'name'   => __( 'Malaysian Ringgit', 'pods' ),
				'sign'   => 'MR',
				'entity' => 'MR',
			),
			'mxn'     => array(
				'label'  => 'MXN',
				'name'   => __( 'Mexican Peso', 'pods' ),
				'sign'   => '$',
				'entity' => '&#36;',
			),
			'nzd'     => array(
				'label'  => 'NZD',
				'name'   => __( 'New Zealand Dollar', 'pods' ),
				'sign'   => '$',
				'entity' => '&#36;',
			),
			'nok'     => array(
				'label'  => 'NOK',
				'name'   => __( 'Norwegian Krone', 'pods' ),
				'sign'   => 'kr',
				'entity' => 'kr',
			),
			'php'     => array(
				'label'  => 'PHP',
				'name'   => __( 'Philippine Peso', 'pods' ),
				'sign'   => '₱',
				'entity' => '&#x20B1;',
			),
			'pln'     => array(
				'label'  => 'PLN',
				'name'   => __( 'Polish Złoty', 'pods' ),
				'sign'   => 'zł',
				'entity' => 'z&#x142;',
			),
			'rub'     => array(
				'label'  => 'RUB',
				'name'   => __( 'Russian Ruble', 'pods' ),
				'sign'   => '₽',
				'entity' => '&#8381;',
			),
			'sek'     => array(
				'label'  => 'SEK',
				'name'   => __( 'Swedish Krona', 'pods' ),
				'sign'   => 'kr',
				'entity' => 'kr',
			),
			'sgd'     => array(
				'label'  => 'SGD',
				'name'   => __( 'Singapore Dollar', 'pods' ),
				'sign'   => '$',
				'entity' => '&#36;',
			),
			'zar'     => array(
				'label'  => 'ZAR',
				'name'   => __( 'South African Rand', 'pods' ),
				'sign'   => 'R',
				'entity' => 'R',
			),
			'chf'     => array(
				'label'  => 'CHF',
				'name'   => __( 'Swiss Franc', 'pods' ),
				'sign'   => 'Fr',
				'entity' => 'Fr',
			),
			'twd'     => array(
				'label'  => 'TWD',
				'name'   => __( 'Taiwan New Dollar', 'pods' ),
				'sign'   => '$',
				'entity' => '&#36;',
			),
			'thb'     => array(
				'label'  => 'THB',
				'name'   => __( 'Thai Baht', 'pods' ),
				'sign'   => '฿',
				'entity' => '&#x0E3F;',
			),
			'trl'     => array(
				'label'  => 'TRL',
				'name'   => __( 'Turkish Lira', 'pods' ),
				'sign'   => '₺',
				'entity' => '&#8378;',
			),
			'usd'     => array(
				'label'  => 'USD',
				'name'   => __( 'US Dollar', 'pods' ),
				'sign'   => '$',
				'entity' => '&#36;',
			),
			'usdcent' => array(
				'label'  => 'USDCENT',
				'name'   => __( 'US Dollar Cent', 'pods' ),
				'sign'   => '¢',
				'entity' => '&cent;',
			),
			'vnd'     => array(
				'label'  => 'VND',
				'name'   => __( 'Vietnamese Dong', 'pods' ),
				'sign'   => '₫',
				'entity' => '&#8363;',
			),
		);

		/**
		 * Add custom currencies
		 *
		 * @param  array $options {
		 *                        Required array of arrays.
		 *
		 * @type  array {
		 * @type  string $label   The label (example: USD).
		 * @type  string $name    The full name (example: US Dollar).
		 * @type  string $sign    The sign (example: $).
		 * @type  string $entity  The HTML entity (example: &#36;).
		 *     }
		 * }
		 * @return array
		 */
		static::$currencies = apply_filters( 'pods_form_ui_field_currency_currencies', $default_currencies );

		// Sort the currencies
		ksort( static::$currencies );

		// Backwards compatibility
		foreach ( static::$currencies as $key => $value ) {
			if ( is_string( $value ) ) {
				static::$currencies[ $key ] = array(
					'label'  => strtoupper( $key ),
					'name'   => strtoupper( $key ),
					'sign'   => $value,
					'entity' => $value,
				);
			} elseif ( is_array( $value ) ) {
				// Make sure all required values are set
				if ( empty( $value['label'] ) ) {
					$value['label'] = $key;
				}
				if ( empty( $value['name'] ) ) {
					$value['name'] = $key;
				}
				if ( empty( $value['sign'] ) ) {
					$value['sign'] = $key;
				}
				if ( empty( $value['entity'] ) ) {
					$value['entity'] = $key;
				}
			} else {
				// Invalid
				unset( static::$currencies[ $key ] );
			}//end if
		}//end foreach

		return static::$currencies;
	}
384181
public function getSortedPurses()
    {
        $purses = $this->purses;
        if (empty($purses)) {
            return $purses;
        }

        $getOrder = function ($currency) {
            $order = ['usd' => 0, 'eur' => 1];

            return $order[$currency] ?? 100;
        };

        usort($purses, function ($a, $b) use ($getOrder) {
            return $getOrder($a->currency) <=> $getOrder($b->currency);
        });

        return $purses;
    }
1227322
def currency(s=''):
    ''
    if isinstance(s, str):
        s = ''.join(ch for ch in s if ch in floatchars)
    return float(s) if s else TypedWrapper(float, None)
730401
private function getCurrencies()
    {
        if (null === self::$currencies) {
            self::$currencies = $this->loadCurrencies();
        }

        return self::$currencies;
    }
738662
def get_supported_currency_choices(api_key):
	
	import stripe

	stripe.api_key = api_key

	account = stripe.Account.retrieve()
	supported_payment_currencies = stripe.CountrySpec.retrieve(account["country"])[
		"supported_payment_currencies"
	]

	return [(currency, currency.upper()) for currency in supported_payment_currencies]
1170796
function Money(knwlInstance) {
    var isoTypes =
        [
            {
                iso: 'EUR',
                match: '^euro?s?$'
            }
        ,
            {
                iso: 'USD',
                match: '^usd?s?$'
            }
        ]


    var formats = [
        '^(?!0\.00)[0-9]{1,3}(,[0-9]{3})*(\.[0-9][0-9])?$', // EUR,USD
        '^(?!0,00)[0-9]{1,3}(\.[0-9]{3})*(,[0-9][0-9])?$' // inverted EUR, USD
    ]



    this.calls = function() {
        var words = knwlInstance.words.get('linkWords');              // get the String as an array of linked Words
        var results = [];                                         // prepare results
        var typeFound = {
            index: null
        }
        var quantityFound = {
            index: null
        }

        words.forEach( function(word) {                           // check each word



            formats.some( function(format){
                 var regEx = new RegExp(format);
                 var regExRes = regEx.exec(word);
                 if( regExRes != null) {
                     quantityFound.index = 0;
                     quantityFound.quantity = regExRes[0];
                     return true;
                 }
            });
            isoTypes.some( function(type){
                 regEx = new RegExp(type.match);
                 var regExRes = regEx.exec(word);
                 typeFound.value = type.iso;
                 if( regExRes != null) {
                     typeFound.index = 0;
                     return true;
                 }
            });


            if (quantityFound.index === 0 ){
                if (typeFound.index === 1){
                    results.push(
                        {type: typeFound.value,
                        quantity: quantityFound.quantity,
                        value: typeFound.value + ' ' + quantityFound.quantity
                        });
                }
            }

            if (quantityFound.index === 1 ){
                if (typeFound.index === 0){
                    results.push(
                        {type: typeFound.value,
                        quantity: quantityFound.quantity,
                        value: typeFound.value + ' ' + quantityFound.quantity
                        });
                }
            }


            quantityFound.index++;
            typeFound.index++;
        });

        return results;
    };
}
38044
public function getAvailableCurrencies() : array
    {
        if ($this->isPartial) {
            foreach ($this->currencyData as $currencyCode => $data) {
                if (! isset($this->currencies[$currencyCode])) {
                    $this->currencies[$currencyCode] = new Currency(... $data);
                }
            }

            ksort($this->currencies);

            $this->isPartial = false;
        }

        return $this->currencies;
    }
702765
function(sCurrency) {

			// try to lookup currency digits from custom currencies
			var mCustomCurrencies = this._get("currency");
			if (mCustomCurrencies) {
				if (mCustomCurrencies[sCurrency] && mCustomCurrencies[sCurrency].hasOwnProperty("digits")) {
					return mCustomCurrencies[sCurrency].digits;
				} else if (mCustomCurrencies["DEFAULT"] && mCustomCurrencies["DEFAULT"].hasOwnProperty("digits")) {
					return mCustomCurrencies["DEFAULT"].digits;
				}
			}

			var iDigits = this._get("currencyDigits", sCurrency);
			if (iDigits == null) {
				iDigits = this._get("currencyDigits", "DEFAULT");

				if (iDigits == null) {
					iDigits = 2; // default
				}
			}
			return iDigits;
		}
1102823
function autoCurrencyList()
    {
        // 'auto currencies' are the currencies used for 'auto' prices.
        // 'auto currencies' = 'all currencies' - 'currencies of custom prices'

        $autoCurrecyList = $this->currencyList();
        $customPriceList = $this->customPriceList();
        foreach ( $customPriceList as $price )
        {
            if ( $price )
            {
                $currencyCode = $price->attribute( 'currency_code' );
                unset( $autoCurrecyList[$currencyCode] );
            }
        }

        return $autoCurrecyList;
    }