Sets/overrides main currency

@param float $amount
@param string $currency
@throws \RuntimeException if main currency is out of the list
@return void
482566
public function set($amount, $currency)
    {
        if ($this->isAvailable($currency)) {
            $this->base = $amount * $this->rates[$currency];
        } else {
            throw new RuntimeException(sprintf(
                'Can not set main rate "%s" that do not belong to initial collection of rates', $currency
            ));
        }
    }
1232605
public void deleteCurrency(Currency currency) {
        if (currencyList.containsKey(currency.getName())) {
            Common.getInstance().getStorageHandler().getStorageEngine().deleteCurrency(currency);
            currencyList.remove(currency.getName());
        }
    }
379896
private function _checkCurrency(&$currency)
    {
        if (!isset($currency)) {
            throw new Klarna_ArgumentNotSetException("Currency");
        }
        if (is_numeric($currency) && !is_int($currency)) {
            $currency = intval($currency);
        }
        if (!is_numeric($currency) || !is_int($currency)) {
            throw new Klarna_InvalidTypeException("Currency", "integer");
        }
    }
654548
def set_money_currency(self, money_currency):
        
        if money_currency not in self.money_formats:
            raise CurrencyDoesNotExist

        self.money_currency = money_currency
313644
public function convert($currency)
    {
        if ($this->isAvailable($currency)) {
            $rate = 1 / $this->rates[$currency];
            return round($this->base * $rate, 2);
        } else {
            throw new RuntimeException(sprintf(
                'Target currency "%s" does not belong to the registered map of rates', $currency
            ));
        }
    }
1171784
private function createMoney($amount, $currency) { $precision = isset($this->config[$currency]) ? $this->config[$currency]['precision'] : 2;
        return new Money($amount, new Currency($currency, $precision));
    }
1221546
public function setAmount(float $amount): self
    {
        $this->amount = (int) ($amount * self::FACTOR_AMOUNT);
        return $this;
    }
138255
public function setCurrencyId( $currencyid )
	{
		if ( $currencyid == $this->getCurrencyId() ) { return; }

		$this->_checkCurrencyId( $currencyid, false );
		$this->_values['currencyid'] = $currencyid;
		$this->setModified();
	}
661474
public function create($amount, $currency)
    {
        $result = new Money($amount, $currency);
        $this->validator->validateMoney($result);
        return $result;
    }
1299646
protected function delete($currency)
    {
        $this->output->write("Deleting {$currency} currency...");

        if (is_string($result = $this->storage->delete($currency))) {
            $this->output->writeln('<error>' . ($result ?: 'Failed') . '</error>');
        }
        else {
            $this->output->writeln("<info>success</info>");
        }
    }
41279
protected function checkCurrencies($currencies)
    {
        foreach ((array) $currencies as $currency) {
            if (!$this->hasCurrency($currency)) {
                throw new InvalidCurrencyException(sprintf('"%s" is an unknown currency code.', $currency));
            }
        }
    }
62862
protected function transformAmount($amount = '', $currency = '')
    {
        if (!empty($amount) && !empty($currency)) {
            return \Genesis\Utils\Currency::amountToExponent($amount, $currency);
        }

        return false;
    }
1280423
public function setAmount($amount)
    {
        if ($amount instanceof DBMoney) {
            $this->setField('Money', $amount);
        } elseif ($this->Status == 'Created' && is_numeric($amount)) {
            $this->MoneyAmount = $amount;
        }
        return $this;
    }
366441
public static function withSecure($amount, Currency $currency = null)
    {
        if(!is_long($amount))
            throw new InvalidAmountException;
        $money = self::withRaw(0, $currency);
        $money->setFraction($amount / 100);
        $money->setWhole($amount / 100);
        return $money;
    }
473172
private function setFraction($amount)
    {
        $doubleFraction = $amount * 100;
        $intFraction = ($this->round(abs($doubleFraction))) % 100;
        if($intFraction < 0)
            $intFraction = -$intFraction;
        $this->fraction = $intFraction;
    }
577964
public static function of($amount, $currency) : RationalMoney
    {
        $amount = BigRational::of($amount);

        if (! $currency instanceof Currency) {
            $currency = Currency::of($currency);
        }

        return new RationalMoney($amount, $currency);
    }
251024
public function setAmount($amount)
    {
        $amount = (int) (string) $amount;

        if (!Icepay_Parameter_Validation::amount($amount))
            throw new Exception('Amount not valid');
        $this->data->ic_amount = $amount;
        return $this;
    }