Returns a Money whose value is the absolute value of this Money.

The resulting Money has the same context as this Money.

@return Money
423005
public function abs() : Money
    {
        return new Money($this->amount->abs(), $this->currency, $this->context);
    }
374943
public static function GetBaseCurrency()
    {
        static $oInstance = null;
        if (null === $oInstance) {
            $oInstance = TdbPkgShopCurrency::GetNewInstance();
            if (false === $oInstance->LoadFromField('is_base_currency', '1')) {
                $oInstance = false;
            }
        }

        return $oInstance;
    }
1046789
public function sameValueAs(ValueObjectInterface $currency)
    {
        if (false === Util::classEquals($this, $currency)) {
            return false;
        }

        return $this->getCode()->toNative() == $currency->getCode()->toNative();
    }
148615
@Override
    public Money remainder(Number divisor) {
        if (NumberVerifier.isInfinityAndNotNaN(divisor)) {
            return new Money(BigDecimal.ZERO, getCurrency());
        }
        BigDecimal bd = MoneyUtils.getBigDecimal(divisor);
        return new Money(this.number.remainder(bd), getCurrency());
    }
642410
public double getAndSet(double amount) {
    long v = value.getAndSet(Double.doubleToLongBits(amount));
    return Double.longBitsToDouble(v);
  }
1231636
protected function getPriceValueAttribute()
    {
        $obPriceModel = $this->getPriceObject($this->getActivePriceType());
        $this->setActivePriceType(null);

        if (empty($obPriceModel)) {
            return 0;
        }

        $fPrice = $obPriceModel->price_value;
        $fPrice = CurrencyHelper::instance()->convert($fPrice, $this->getActiveCurrency());

        return $fPrice;
    }
1308435
@Override
    public Money stripTrailingZeros() {
        if (isZero()) {
            return new Money(BigDecimal.ZERO, getCurrency());
        }
        return new Money(this.number.stripTrailingZeros(), getCurrency(), monetaryContext);
    }
1172442
public function getCurrency()
    {
        $currency = Currency::getCurrencyInstance($this->getOrder()->source->id_currency);
        $result = array (
            Meta::Currency => $currency->iso_code,
            Meta::CurrencyRate => (float) $this->source->conversion_rate,
            Meta::CurrencyDoConvert => true,
        );
        return $result;
    }
80168
@Override
    public Money multiply(Number multiplicand) {
    	NumberVerifier.checkNoInfinityOrNaN(multiplicand);
        BigDecimal multiplicandBD = MoneyUtils.getBigDecimal(multiplicand);
        if (multiplicandBD.equals(BigDecimal.ONE)) {
            return this;
        }
        MathContext mc = MoneyUtils.getMathContext(monetaryContext, RoundingMode.HALF_EVEN);
        BigDecimal dec = this.number.multiply(multiplicandBD, mc);
        return new Money(dec, getCurrency(), monetaryContext);
    }
495682
public function amount($money)
    {
        if (null === $money) {
            return;
        }

        if (is_string($money) || $money < 0) {
            throw new InvalidArgumentException('Money amount must be a positive number.');
        }

        if ($this->getMoneyFormat() === 'cents') {
            return number_format($money, 0, '', '');
        }

        return sprintf('%.2f', number_format($money, 2, '.', '') / 100);
    }
769153
public function getCurrency()
    {
        if (! empty($this->currency)) {
            return $this->currency;
        }

        return $this->setCurrency(config('currency.default'))->getCurrency();
    }
1049409
protected function getCurrencyCodeAttribute()
    {
        if (empty($this->sActiveCurrency)) {
            return CurrencyHelper::instance()->getActiveCurrencyCode();
        }

        $sResult = CurrencyHelper::instance()->getCurrencyCode($this->sActiveCurrency);
        $this->sActiveCurrency = null;

        return $sResult;
    }
661428
public function getValue()
    {
        if (!$this->exists()) {
            return null;
        }
        $amount = $this->getAmount();
        $currency = $this->getCurrency();
        if (empty($currency)) {
            return $amount;
        }
        return $amount . ' ' . $currency;
    }
443579
public function extract($value)
    {
        if (!$value instanceof Money) {
            throw new \InvalidArgumentException(sprintf(
                '$value expected type SCL\Currency\Money, got "%s"',
                is_object($value) ? get_class($value) : gettype($value)
            ));
        }

        return $value->getValue();
    }
1228256
public function subtract(Money $money)
    {
        if (!$this->currency->equals($money->getCurrency())) {
            throw new CurrencyMismatchException($this.' does not match '.$money);
        }

        $amount = bcsub($this->amount, $money->getAmount(), self::BCSCALE);

        return self::valueOf($amount, $this->currency);
    }
834947
public function getCurrency() : ?string 
    {
        if ( ! $this->hasCurrency()) {
            $this->setCurrency($this->getDefaultCurrency());
        }
        return $this->currency;
    }
929987
protected function getCurrencyAttribute()
    {
        if (empty($this->sActiveCurrency)) {
            return CurrencyHelper::instance()->getActiveCurrencySymbol();
        }

        $sResult = CurrencyHelper::instance()->getCurrencySymbol($this->sActiveCurrency);
        $this->sActiveCurrency = null;

        return $sResult;
    }