Returns the total amount of the <code>currency</code> in this balance.

@return the total amount.
335645
public BigDecimal getTotal() {

    if (total == null) {
      return available.add(frozen).subtract(borrowed).add(loaned).add(withdrawing).add(depositing);
    } else {
      return total;
    }
  }
181791
public MoneyFormatterBuilder appendAmount() {
        AmountPrinterParser pp = new AmountPrinterParser(MoneyAmountStyle.ASCII_DECIMAL_POINT_GROUP3_COMMA);
        return appendInternal(pp, pp);
    }
866095
public static function getStoreAmountOfCurrency($amount, $currencyCode) {
        $currencyCode   = strtoupper($currencyCode);
        $amount         = (int) $amount;

        if( in_array($currencyCode, self::FULL_VALUE_CURRENCIES, true) ) {
            return (float) $amount;
        }

        if( in_array($currencyCode, self::DIV_1000_VALUE_CURRENCIES, true) ) {
            return (float) ($amount / self::DIV_1000);
        }

        return (float) ($amount / self::DIV_100);
    }
527013
protected String getToken(MonetaryAmount amount) {
        switch (style) {
            case NUMERIC_CODE:
                return String.valueOf(amount.getCurrency()
                        .getNumericCode());
            case NAME:
                return getCurrencyName(amount.getCurrency());
            case SYMBOL:
                // Fix for https://github.com/JavaMoney/jsr354-ri/issues/151
                if("BG".equals(locale.getCountry())){
                    return "лв";
                }
                return getCurrencySymbol(amount.getCurrency());
            default:
            case CODE:
                return amount.getCurrency().getCurrencyCode();
        }
    }
1359174
public com.google.api.ads.adwords.axis.v201809.cm.Money getMoney() {
        return money;
    }
1107103
@Override
    public ExchangeRate getExchangeRate(MonetaryAmount amount) {
        return this.rateProvider.getExchangeRate(ConversionQueryBuilder
                .of(conversionQuery).setBaseCurrency(amount.getCurrency())
                .build());
        // return this.rateProvider.getExchangeRate(amount.getCurrency(),
        // getCurrency());
    }
44741
public double getAverage() {
        if (!DATA_LIST.isEmpty()) {
            double sum = 0;
            for (DataPoint dataPoint : DATA_LIST) {
                sum += dataPoint.getValue();
            }
            return sum / DATA_LIST.size();
        }
        return 0;
    }
813736
public CoinbaseAccount getCoinbaseAccount(Currency currency) throws IOException {
    String apiKey = exchange.getExchangeSpecification().getApiKey();
    BigDecimal timestamp = coinbase.getTime(Coinbase.CB_VERSION_VALUE).getData().getEpoch();

    return coinbase
        .getAccount(
            Coinbase.CB_VERSION_VALUE,
            apiKey,
            signatureCreator2,
            timestamp,
            currency.getCurrencyCode())
        .getData();
  }
660804
public function getCurrencies()
    {
        if ($this->currencies_cache === null) {
            if (config('app.debug', false) === true) {
                $this->currencies_cache = $this->getDriver()->all();
            }
            else {
                $this->currencies_cache = $this->cache->rememberForever('torann.currency', function () {
                    return $this->getDriver()->all();
                });
            }
        }

        return $this->currencies_cache;
    }
586358
protected function getTotal()
	{
		if (null == $this->_total) {
			$this->_total = 0;
			foreach ($this->types as $type) {
				if (isset($type['value'])) {
					$this->_total += $type['value'];
				}
			}
		}
		return $this->_total;
	}
1270377
public double sum() {
        double sum = 0;
        TIntDoubleIterator iter = edges.iterator();
        while (iter.hasNext()) {
            iter.advance();
            sum += iter.value();
        }
        return sum;
    }
77887
public function amount()
    {
        // Indian Rupee use special format
        if ($this->currency->getCode() == 'INR') {
            $decimals = null;
            $amount = $this->amount;

            // Extract decimals from amount
            if (($pos = strpos($amount, ".")) !== false) {
                $decimals = substr(round(substr($amount, $pos), 2), 1);
                $amount = substr($amount, 0, $pos);
            }

            // Extract last 3 from amount
            $result = substr($amount, -3);
            $amount = substr($amount, 0, -3);

            // Apply digits 2 by 2
            while (strlen($amount) > 0) {
                $result = substr($amount, -2).",".$result;
                $amount = substr($amount, 0, -2);
            }

            return $result.$decimals;
        }

        // Return western format
        return number_format(
            $this->amount,
            $this->currency->getPrecision(),
            $this->currency->getDecimalSeparator(),
            $this->currency->getThousandSeparator()
        );
    }
956410
public double getAverage() {
        readLock.lock();
        try {
            // any values at all, needed to avoid a DivideByZero exception
            if (this.values.size() <= 0) {
                return 0;
            }
            return ((double)this.total / (double)this.values.size());
        } finally {
            readLock.unlock();
        }
    }
70983
@Override
    public MonetaryAmountFactory<T> setCurrency(String currencyCode) {
        this.currency = Monetary.getCurrency(currencyCode);
        return this;
    }
641877
public NumberExpression<T> sum() {
        if (sum == null) {
            sum = Expressions.numberOperation(getType(), Ops.AggOps.SUM_AGG, mixin);
        }
        return sum;
    }
1334888
public int totalCountOfValues() {
        int count = 0;

        for (V v : valueMap.values()) {
            count += v.size();
        }

        return count;
    }
1066642
@Override
    public boolean isLessThan(MonetaryAmount amount) {
        MoneyUtils.checkAmountParameter(amount, currency);
        return number.stripTrailingZeros()
                .compareTo(amount.getNumber().numberValue(BigDecimal.class).stripTrailingZeros()) < 0;
    }