Set a currency data
@param string $code
425835
protected function setCurrency($code)
    {
        $this->data_currency = array();

        if (!empty($code)) {
            $this->data_currency = $this->currency->get($code);
            if (empty($this->data_currency)) {
                $this->outputHttpStatus(404);
            }
        }
    }
637423
public function set(string $currency): void
    {
        $this->request->session()->put(
            $this->config->key,
            $this->value($currency)
        );
    }
312220
public function getCurrencyIdByCode($code) {
        $this->sError = FALSE;

        if ($this->_currencyCode2Id === FALSE) {
            $this->_loadCurrencyCodes();
        }

        if (!isset($this->_currencyCode2Id[$code])) {
            $this->sError = 'Incorect currency code: ' . $code;
            return FALSE;
        }

        return $this->_currencyCode2Id[$code];
    }
1225894
public static function setStatus($code) {

		if(false === ('-' . intval($code) == '-' . $code)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($code)), E_USER_ERROR);
		}

		$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';

		switch($code) {

			case 100 : header($protocol . ' 100 Continue'); break;
			case 101 : header($protocol . ' 101 Switching Protocols'); break;
			case 102 : header($protocol . ' 102 Processing'); break;
			case 200 : header($protocol . ' 200 OK'); break;
			case 201 : header($protocol . ' 201 Created'); break;
			case 202 : header($protocol . ' 202 Accepted'); break;
			case 203 : header($protocol . ' 203 Non-Authoritative Information'); break;
			case 204 : header($protocol . ' 204 No Content'); break;
			case 205 : header($protocol . ' 205 Reset Content'); break;
			case 206 : header($protocol . ' 206 Partial Content'); break;
			case 207 : header($protocol . ' 207 Multi-Status'); break;
			case 208 : header($protocol . ' 208 Already Reported'); break;
			case 226 : header($protocol . ' 226 IM Used'); break;
			case 300 : header($protocol . ' 300 Multiple Choices'); break;
			case 301 : header($protocol . ' 301 Moved Permanently'); break;
			case 302 : header($protocol . ' 302 Found'); break;
			case 303 : header($protocol . ' 303 See Other'); break;
			case 304 : header($protocol . ' 304 Not Modified'); break;
			case 305 : header($protocol . ' 305 Use Proxy'); break;
			case 306 : header($protocol . ' 306 Switch Proxy'); break;
			case 307 : header($protocol . ' 307 Temporary Redirect'); break;
			case 308 : header($protocol . ' 308 Permanent Redirect'); break;
			case 400 : header($protocol . ' 400 Bad Request'); break;
			case 401 : header($protocol . ' 401 Unauthorized'); break;
			case 402 : header($protocol . ' 402 Payment Required'); break;
			case 403 : header($protocol . ' 403 Forbidden'); break;
			case 404 : header($protocol . ' 404 Not Found'); break;
			case 405 : header($protocol . ' 405 Method Not Allowed'); break;
			case 406 : header($protocol . ' 406 Not Acceptable'); break;
			case 407 : header($protocol . ' 407 Proxy Authentication Required'); break;
			case 408 : header($protocol . ' 408 Request Timeout'); break;
			case 409 : header($protocol . ' 409 Conflict'); break;
			case 410 : header($protocol . ' 410 Gone'); break;
			case 411 : header($protocol . ' 411 Length Required'); break;
			case 412 : header($protocol . ' 412 Precondition Failed'); break;
			case 413 : header($protocol . ' 413 Payload Too Large'); break;
			case 414 : header($protocol . ' 414 Request-URI Too Long'); break;
			case 415 : header($protocol . ' 415 Unsupported Media Type'); break;
			case 416 : header($protocol . ' 416 Requested Range Not Satisfiable'); break;
			case 417 : header($protocol . ' 417 Expectation Failed'); break;
			case 418 : header($protocol . ' 418 I\'m a teapot'); break;
			case 419 : header($protocol . ' 419 Authentication Timeout'); break;
			case 420 : header($protocol . ' 420 Method Failure'); break;
			case 421 : header($protocol . ' 421 Misdirected Request'); break;
			case 422 : header($protocol . ' 422 Unprocessable Entity'); break;
			case 423 : header($protocol . ' 423 Locked'); break;
			case 424 : header($protocol . ' 424 Failed Dependency'); break;
			case 426 : header($protocol . ' 426 Upgrade Required'); break;
			case 428 : header($protocol . ' 428 Precondition Required'); break;
			case 429 : header($protocol . ' 429 Too Many Requests'); break;
			case 431 : header($protocol . ' 431 Request Header Fields Too Large'); break;
			case 440 : header($protocol . ' 440 Login Timeout '); break;
			case 444 : header($protocol . ' 444 No Response'); break;
			case 449 : header($protocol . ' 449 Retry With'); break;
			case 450 : header($protocol . ' 450 Blocked by Windows Parental Controls'); break;
			case 451 : header($protocol . ' 451 Unavailable For Legal Reasons'); break;
			case 494 : header($protocol . ' 494 Request Header Too Large'); break;
			case 495 : header($protocol . ' 495 Cert Error'); break;
			case 496 : header($protocol . ' 496 No Cert'); break;
			case 497 : header($protocol . ' 497 HTTP to HTTPS'); break;
			case 498 : header($protocol . ' 498 Token expired/invalid'); break;
			case 499 : header($protocol . ' 499 Client Closed Request'); break;
			case 500 : header($protocol . ' 500 Internal Server Error'); break;
			case 501 : header($protocol . ' 501 Not Implemented'); break;
			case 502 : header($protocol . ' 502 Bad Gateway'); break;
			case 503 : header($protocol . ' 503 Service Unavailable'); break;
			case 504 : header($protocol . ' 504 Gateway Timeout'); break;
			case 505 : header($protocol . ' 505 HTTP Version Not Supported'); break;
			case 506 : header($protocol . ' 506 Variant Also Negotiates'); break;
			case 507 : header($protocol . ' 507 Insufficient Storage'); break;
			case 508 : header($protocol . ' 508 Loop Detected'); break;
			case 509 : header($protocol . ' 509 Bandwidth Limit Exceeded'); break;
			case 510 : header($protocol . ' 510 Not Extended'); break;
			case 511 : header($protocol . ' 511 Network Authentication Required'); break;
			case 520 : header($protocol . ' 520 Unknown Error'); break;
			case 522 : header($protocol . ' 522 Origin Connection Time-out'); break;
			case 598 : header($protocol . ' 598 Network read timeout error'); break;
			case 599 : header($protocol . ' 599 Network connect timeout error'); break;
		}
	}
1234329
protected function setTitleEditCurrency()
    {
        if (isset($this->data_currency['code'])) {
            $title = $this->text('Edit %name', array('%name' => $this->data_currency['name']));
        } else {
            $title = $this->text('Add currency');
        }

        $this->setTitle($title);
    }
680323
protected function fixTypes(array $data, array $typeMap, $currencyCode)
    {
        if (empty($typeMap)) {
            $typeMap = $this->attributeTypeMap;
        }

        if (empty($currencyCode)) {
            $currencyCode = $this->_getStore()->getDefaultCurrencyCode();
        }

        foreach ($typeMap as $code => $type) {
            if (array_key_exists($code, $data) && (is_scalar($data[$code]) || is_null($data[$code]))) {
                switch ($type) {
                    case 'bool':
                        $data[$code] = (!empty($data[$code]) && strtolower($data[$code]) !== 'false');
                        break;
                    case 'int':
                        $data[$code] = intval($data[$code]);
                        break;
                    case 'float':
                        $data[$code] = floatval($data[$code]);
                        break;
                    case 'currency':
                        $amount = floatval($data[$code]);
                        $precision = Zend_Locale_Data::getContent(null, 'currencyfraction', $currencyCode);
                        if ($precision === false) {
                            $precision = Zend_Locale_Data::getContent(null, 'currencyfraction');
                        }
                        if ($precision !== false) {
                            $amount = round($amount, $precision);
                            $formatted = Mage::app()->getLocale()->currency($currencyCode)->toCurrency($amount, ['precision' => $precision]);
                        } else {
                            $formatted = Mage::app()->getLocale()->currency($currencyCode)->toCurrency($amount);
                        }
                        $data[$code] = ['currency' => $currencyCode, 'amount' => $amount, 'formatted' => $formatted];
                        break;
                    case 'string':
                    default:
                        $data[$code] = (is_null($data[$code]) ? $data[$code] : (string)$data[$code]);
                        break;
                }
            }
        }

        return $data;
    }
807581
protected function setCurrency($currency): void
    {
        if ( ! $currency instanceof Currency) {
            $currency = new Currency(strtoupper($currency));
        }

        $this->currency = $currency;
    }
1238728
public function set(string $currency): void
    {
        cookie()->queue(
            $this->config->key,
            $this->value($currency)
        );
    }
459441
public function setCurrency($currency)
    {
      if(!is_string($currency) || strlen(trim($currency)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid currency, must be a non empty string');

      $this->currency = $currency;
    }
1179969
public function setCurrency($currency)
    {
        if ($currency) {
            $currency = strtoupper($currency);
            Currency::getNumericCode($currency); // ensure currency support
            $this->currency = $currency;
        } else {
            $this->currency = null;
        }

        return $this;
    }
1352359
private function setCurrency(Currency $currency = null)
    {
        if($currency != null)
            $this->currency = $currency;
        else
        {
            $this->currency = new Currency();
        }
    }
893181
protected function getCurrency($currencyCode, $locale)
    {
        if (!isset($this->currencies[$currencyCode][$locale])) {
            try {
                $currency = $this->currencyRepository->get($currencyCode, $locale);
            } catch (UnknownCurrencyException $e) {
                // The requested currency was not found. Fall back
                // to a dummy object to show just the currency code.
                $currency = new Currency([
                   'currency_code' => $currencyCode,
                   'name' => $currencyCode,
                   'numeric_code' => '000',
                   'locale' => $locale,
                ]);
            }
            $this->currencies[$currencyCode][$locale] = $currency;
        }

        return $this->currencies[$currencyCode][$locale];
    }
451653
public function loadCurrenciesForCountry($code)
    {
        $currencies = $this->helper->loadJson(
            $this->helper->dataDir('currencies/default/'.strtolower($code).'.json')
        );

        return $currencies;
    }
488003
protected function updateCurrency($code)
    {
        if (!$this->isError() && !$this->currency->update($code, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
1063598
public CurrencyUnitBuilder setCurrencyCode(String currencyCode) {
        Objects.requireNonNull(currencyCode, "currencyCode required");
        this.currencyCode = currencyCode;
        this.currencyContext = CurrencyContextBuilder.of(getClass().getSimpleName()).build();
        return this;
    }
689781
function fetchCurrency( $code )
    {
        $currency = eZCurrencyData::fetch( $code );
        if ( is_object( $currency ) )
            $result = array( 'result' => $currency );
        else
            $result = array( 'result' => false );

        return $result;
    }
387045
public function setAmount($amount, $currencyCode = null)
    {
        $this->getRequest()->setParameter('AMT', $amount);
        if (!$currencyCode) {
            $currencyCode = \OxidEsales\Eshop\Core\Registry::getConfig()->getActShopCurrencyObject()->name;
        }
        $this->getRequest()->setParameter('CURRENCYCODE', $currencyCode);
    }