Sets the default currency
181204
public function setDefaultAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) {
            return $response;
        }

        $changeEvent = new CurrencyUpdateEvent((int) $this->getRequest()->get('currency_id', 0));

        // Create and dispatch the change event
        $changeEvent->setIsDefault(true)->setVisible(1);

        try {
            $this->dispatch(TheliaEvents::CURRENCY_SET_DEFAULT, $changeEvent);
        } catch (\Exception $ex) {
            // Any error
            return $this->errorPage($ex);
        }

        return $this->redirectToListTemplate();
    }
609379
function init(defaultLocale, defaultLocaleAssetUrl, defaultCurrency) {
    // Store default/initial settings.
    _defaultLocale = defaultLocale;
    _defaultLocaleAssetUrl = defaultLocaleAssetUrl;
    _defaultCurrency = defaultCurrency;

    // Store default currency against the Currency object.
    Currency.currentCurrency = _defaultCurrency;

    // See if we have a saved locale in our cookie that's different to our current one. If so, translate to it.
    var cookieLocale = localeCookie.read();
    if(cookieLocale && cookieLocale.length && (cookieLocale != _defaultLocale)) {
      translate(cookieLocale);
    }

    // See if we have a saved currency in our cookie that's different to our current one. If so, convert to it.
    var cookieCurrency = Currency.cookie.read();
    if(cookieCurrency && cookieCurrency.length && (cookieCurrency != _defaultCurrency)) {
      convert(cookieCurrency);
    }

    // Create event listeners.
    $(document).on('change', '[data-change="locale"]', localeChangedHandler);
    $(document).on('change', '[data-change="currency"]', currencyChangedHandler);
    $(document).on('click', '[data-toggle="currency"]', currencyToggledHandler);
  }
818407
@Override
    public MonetaryAmountFactory<T> setAmount(MonetaryAmount amount) {
        this.currency = amount.getCurrency();
        this.number = amount.getNumber().numberValue(BigDecimal.class);
        this.monetaryContext = MonetaryContextBuilder.of(defaultMonetaryContext.getAmountType())
                .importContext(amount.getContext()).build();
        return this;
    }
323262
public void setCurrency(String currency) {
		currency = StringUtils.upperCase(currency);
		if (!CurrencyUtils.getInstance().isValidCurrency(currency)) {
			currency = "EUR";
		}
		this.currency = currency;
	}
270221
public void setCurrencyAttribute(String name, String value) {
		ensureValue();
		Attribute attribute = new CurrencyAttribute(value);
		attribute.setEditable(isEditable(name));
		getValue().getAllAttributes().put(name, attribute);
	}
190953
public void setCurrencyDigits(Integer currDigs)
   {
      if (currDigs == null)
      {
         currDigs = DEFAULT_CURRENCY_DIGITS;
      }
      set(ProjectField.CURRENCY_DIGITS, currDigs);
   }
1358752
function currency(val) {
  if (!val) return;
  if (typeof val === 'number') return val;
  if (typeof val !== 'string') return;

  val = val.replace(/\$/g, '');
  val = parseFloat(val);

  if (!isNaN(val)) return val;
}
141838
public function setCurrency($currency) {

        $this->checkInArray($currency, GDAXConstants::$currencyValues);
        $this->currency = $currency;
        return $this;

    }
1053177
private void assignCurrencyPrivate(XAttributable element, String currency) {
		if (currency != null && currency.trim().length() > 0) {
			XAttributeLiteral attr = (XAttributeLiteral) ATTR_CURRENCY.clone();
			attr.setValue(currency);
			element.getAttributes().put(KEY_CURRENCY, attr);
		}
	}
1314149
public void initializeCurrency() {
        if (!currencyInitialized) {
            sendConsoleMessage(Level.INFO, getLanguageManager().getString("loading_currency_manager"));
            currencyManager = new CurrencyManager();
            currencyInitialized = true;
            sendConsoleMessage(Level.INFO, getLanguageManager().getString("currency_manager_loaded"));
        }
    }
1238187
protected function registerCurrency()
    {
        $this->app->singleton(Currency::class, function ($app) {
            $repository = new Currency;

            return $repository->setLocale($app['config']['app.locale'])->setFallbackLocale($app['config']['app.fallback_locale']);
        });

        $this->app->alias(Currency::class, 'intl.currency');
    }
408775
public function setCurrency(\Sulu\Bundle\ProductBundle\Entity\Currency $currency = null)
    {
        $this->currency = $currency;

        return $this;
    }
542308
protected function updateCurrency()
    {
        $this->controlAccess('currency_edit');

        if ($this->currency->update($this->data_currency['code'], $this->getSubmitted())) {
            $this->redirect('admin/settings/currency', $this->text('Currency has been updated'), 'success');
        }

        $this->redirect('', $this->text('Currency has not been updated'), 'warning');
    }
1022804
def set_default(self, key, value):
        
        k = self._real_key(key.lower())
        self._defaults[k] = value
1123837
private void processCurrency(Row row)
   {
      String currencyName = row.getString("curr_short_name");
      DecimalFormatSymbols symbols = new DecimalFormatSymbols();
      symbols.setDecimalSeparator(row.getString("decimal_symbol").charAt(0));
      symbols.setGroupingSeparator(row.getString("digit_group_symbol").charAt(0));
      DecimalFormat nf = new DecimalFormat();
      nf.setDecimalFormatSymbols(symbols);
      nf.applyPattern("#.#");
      m_currencyMap.put(currencyName, nf);

      if (currencyName.equalsIgnoreCase(m_defaultCurrencyName))
      {
         m_numberFormat = nf;
         m_defaultCurrencyData = row;
      }
   }
1308056
protected function setBreadcrumbEditCurrency()
    {
        $breadcrumbs = array();

        $breadcrumbs[] = array(
            'url' => $this->url('admin'),
            'text' => $this->text('Dashboard')
        );

        $breadcrumbs[] = array(
            'url' => $this->url('admin/settings/currency'),
            'text' => $this->text('Currencies')
        );

        $this->setBreadcrumbs($breadcrumbs);
    }
978281
public function setPricesCurrency($pricesCurrency = 'RON')
    {
        $pricesCurrency = strtoupper(trim($pricesCurrency));
        switch ($pricesCurrency) {
            case 'ROL':
                $this->pricesCurrency = 'ROL';
                break;

            case 'EUR':
                $this->pricesCurrency = 'EUR';
                break;

            case 'USD':
                $this->pricesCurrency = 'USD';
                break;

            case 'GBP':
                $this->pricesCurrency = 'GBP';
                break;

            case 'BGN':
                $this->pricesCurrency = 'BGN';
                break;

            case 'RON':
            default:
                $this->pricesCurrency = 'RON';
        }

        return true;
    }