Factory for Amount models with MICRO amounts and provided
`divisibility`.

@param   integer     $amount
@param   integer     $divisibility
@return  \NEM\Models\Amount
19159
static public function fromMicro($amount, $divisibility = 6)
    {
        $amt = new Amount(["amount" => $amount]);
        $amt->setDivisibility($divisibility);

        return $amt;
    }
109048
protected function getClosestAcceptedCashAmount($amount): int
    {
        $value = Number::fromString($amount)->getIntegerPart();
        $cent = $amount % 5;

        if ($cent <= 2) {
            $value = $value - $cent;
        } else {
            $value = $value + (5 - $cent);
        }

        return $value;
    }
87248
public function filterByAmount($amount)
    {
        $amount = intval($amount);
        $filteredArr = array();
        foreach ($this->_paymentMethodsArrayFiltered as $paymentMethod) {
            $continue = true;
            foreach ($paymentMethod["Issuers"] as $issuer) {
                foreach ($issuer["Countries"] as $country) {
                    if ($amount >= intval($country["MinimumAmount"]) &&
                            $amount <= intval($country["MaximumAmount"])) {
                        array_push($filteredArr, $paymentMethod);
                        $continue = false;
                    }
                    if (!$continue)
                        break;
                }
                if (!$continue)
                    break;
            }
        }
        $this->_paymentMethodsArrayFiltered = $filteredArr;
        return $this;
    }
1267934
private function getAmount($amount, $currency)
    {
        $list = self::getCurrencyList();

        if (!isset($list[$currency])) {
            throw new \RuntimeException('Invalid currency provided');
        }

        return (int) (100 * bcmul('1', (string) $amount, $list[$currency]['fraction']));
    }
745556
public function multiply(
        Fiat\Money $money,
        $fraction
    ): Fiat\Money {
        return $this->accountant->multiply($money, $fraction);
    }
473172
private function setFraction($amount)
    {
        $doubleFraction = $amount * 100;
        $intFraction = ($this->round(abs($doubleFraction))) % 100;
        if($intFraction < 0)
            $intFraction = -$intFraction;
        $this->fraction = $intFraction;
    }
750064
@Override
    public Money divide(double divisor) {
        if (NumberVerifier.isInfinityAndNotNaN(divisor)) {
            return Money.of(0, getCurrency());
        }
        if (divisor == 1.0d) {
            return this;
        }
        return divide(new BigDecimal(String.valueOf(divisor)));
    }
1136585
@Override
    public FastMoney remainder(Number divisor) {
        checkNumber(divisor);
        return new FastMoney(this.number % getInternalNumber(divisor, false), getCurrency());
    }
1257108
public function setAmount($amount)
    {
      if(!is_int($amount) || $amount < 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid amount, must be a positive integer');

      $this->amount = $amount;
    }
655559
public function divide($number)
    {
        self::mustBeNumeric($number, 'Value to divide');
        
        $number = is_object($number) ? $number->value : $number;
        
        if ($number == 0) {
            throw new \InvalidArgumentException('You cannot divide by zero!');
        }

        return new self($this->value / $number);
    }
322198
public function skip(int $amount)
    {
        $this->items = array_slice($this->items, $amount);

        return $this;
    }
1221546
public function setAmount(float $amount): self
    {
        $this->amount = (int) ($amount * self::FACTOR_AMOUNT);
        return $this;
    }
668079
public function setRows(int $amount)
    {
        if (!$amount) {
            throw new InvalidArgumentException('Rows amount must be set');
        }

        if ($this->rows === $amount) {
            return $this;
        }

        if ($this->rows < $amount) {
            // Add rows
            for ($i = $amount - $this->rows; $i > 0; $i--) {
                $this->structure[] = $this->columns ? array_fill(0, $this->columns, $this->cell_example) : [];
            }
        } else {
            // Remove rows from the end
            $this->structure = \array_slice($this->structure, 0, $amount);
        }

        $this->rows = $amount;

        return $this;
    }
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;
    }
1199869
@Override
    public RoundedMoney divide(Number divisor) {
        BigDecimal bd = MoneyUtils.getBigDecimal(divisor);
        if (isOne(bd)) {
            return this;
        }
        BigDecimal dec = number.divide(bd, Optional.ofNullable(monetaryContext.get(RoundingMode.class)).
                orElse(RoundingMode.HALF_EVEN));
        return new RoundedMoney(dec, currency, rounding).with(rounding);
    }
750141
@Override
    public Money divide(Number divisor) {
        if (NumberVerifier.isInfinityAndNotNaN(divisor)) {
            return Money.of(0, getCurrency());
        }
        BigDecimal divisorBD = MoneyUtils.getBigDecimal(divisor);
        if (divisorBD.equals(BigDecimal.ONE)) {
            return this;
        }
        BigDecimal dec =
                this.number.divide(divisorBD, MoneyUtils.getMathContext(getContext(), RoundingMode.HALF_EVEN));
        return new Money(dec, getCurrency());
    }
186754
public function add(Integer $quantity)
    {
        $amount = new Integer($this->getAmount()->toNative() + $quantity->toNative());
        $result = new self($amount, $this->getCurrency());

        return $result;
    }