Divide a raw amount down by the krai ratio.

        :param amount: Amount in raw to convert to krai
        :type amount: int

        :raises: :py:exc:`nano.rpc.RPCException`

        >>> rpc.krai_from_raw(amount=1000000000000000000000000000)
        1
778294
def krai_from_raw(self, amount):
        

        amount = self._process_value(amount, 'int')

        payload = {"amount": amount}

        resp = self.call('krai_from_raw', payload)

        return int(resp['amount'])
820713
def convert_to(target, amount, date=None, percent=0, valid_days_max=None):
    
    if target.upper() == 'CZK':
        result = amount
    else:
        result = amount / rate(target, date, valid_days_max=valid_days_max)
    return modified(result, percent)
706025
def trunc(ctx, number):
    
    return conversions.to_integer(conversions.to_decimal(number, ctx).to_integral_value(ROUND_DOWN), ctx)
483821
function get(amount) {
  amount = amount !== undefined && amount >= 0 ? amount : 10;
  amount = Math.min(amount, this._records.length);
  return this._records.slice(0, amount);
}
1368732
@Override
    public MonetaryAmount apply(MonetaryAmount amount) {
        requireNonNull(amount, "Amount required.");
        NumberValue num = amount.getNumber();
        BigDecimal one = ONE.setScale(num.getScale() < 5 ? 5 : num.getScale(), HALF_EVEN);
        BigDecimal reciprocal = one.divide(num.numberValue(BigDecimal.class), HALF_EVEN);
        return amount.getFactory().setNumber(reciprocal).create();
    }
1298763
private function adjustAmountByStackQty($amount)
    {
        $qty = $this->getStackQty();

        if ($qty > 1) {
            $amount = $amount / $qty;
        }

        return $amount;
    }
576371
def increment(self, amount=1):
        
        self._primaryProgressBar.setValue(self.value() + amount)
        QApplication.instance().processEvents()
1020475
def increment(field, amount = 1)
      # value = (self[field] || 0) + amount
      # self[field] = value
      # if !@parse_object_id
      #  # TODO - warn that the object must be stored first
      #  return nil
      # end

      body = { field => Parse::Increment.new(amount) }.to_json
      data = @client.request(uri, :put, body)
      parse data
      self
    end
1113667
def decr(self, name, amount=1):
        
        return self.client.decr(name, amount=amount)
525025
def create_integer(self, value: int) -> Integer:
        
        self.append((3, value))
        return self.get(self.raw_count - 1)
254784
def round(self, ndigits=0):
        
        if ndigits is None:
            ndigits = 0
        return self.__class__(
            amount=self.amount.quantize(Decimal('1e' + str(-ndigits))),
            currency=self.currency)
1059678
def split(self, amount):
        
        split_objs = list(self.all())
        if not split_objs:
            raise NoSplitsFoundForRecurringCost()

        portions = [split_obj.portion for split_obj in split_objs]

        split_amounts = ratio_split(amount, portions)
        return [
            (split_objs[i], split_amount)
            for i, split_amount
            in enumerate(split_amounts)
        ]
950922
private function _checkAmount(&$amount)
    {
        if (!isset($amount)) {
            throw new Klarna_ArgumentNotSetException("Amount");
        }
        if (is_numeric($amount)) {
            $this->_fixValue($amount);
        }
        if (is_numeric($amount) && !is_int($amount)) {
            $amount = intval($amount);
        }
        if (!is_numeric($amount) || !is_int($amount)) {
            throw new Klarna_InvalidTypeException("amount", "integer");
        }
    }
904440
def compute_amount(self):
        """"""
        self.amount = self.base_amount * self.aliquot / 100
        return self.amount
661859
def convert_currency(amount, from_currency, to_currency):
    '''
    

    '''
    try:
        rate = CurrencyRate.objects.get(
            from_currency__iso_code=from_currency,
            to_currency__iso_code=to_currency)
    except CurrencyRate.DoesNotExist:
        return _('n/a')
    try:
        history = rate.history.all()[0]
    except IndexError:
        return _('n/a')
    return amount * history.value
733194
def withdraw(self, amount):
        """"""
        if amount > self.balance:
            raise ValueError('Insufficient Funds')
        super().withdraw(amount)
666485
private static function roundUp($amount)
    {
        $result = self::roundTowardsZero($amount);

        if (1 == bccomp($amount, '0', self::BCSCALE) && 0 != bccomp($amount, $result, self::BCSCALE)) {
            $result = bcadd($result, '1', self::BCSCALE);
        }

        return $result;
    }