Package java.math

Examples of java.math.BigDecimal.multiply()


    Instrument underlying = option.getUnderlying();

    TransactionFeeProvider provider = feeProviders.getPluginFor(underlying);
    BigDecimal fee = provider.getTransactionFee(underlying);

    return fee.multiply(multiplier);
  }
}
View Full Code Here


          computedResult = new BigDecimal(n.toString());
        }
        else
        {
          //noinspection ObjectToString
          computedResult = computedResult.multiply(new BigDecimal(n.toString()));
        }
      }
    }

    if (computedResult != null)
View Full Code Here

            for (GenericValue paymentApplication : paymentApplications) {
                invoiceApplied = invoiceApplied.add(paymentApplication.getBigDecimal("amountApplied")).setScale(decimals,rounding);
            }
        }
        if (UtilValidate.isNotEmpty(invoiceApplied) && !actualCurrency) {
            invoiceApplied = invoiceApplied.multiply(getInvoiceCurrencyConversionRate(delegator, invoiceId)).setScale(decimals,rounding);
        }
        return invoiceApplied;
    }
    /**
     * Method to return the total amount of an invoice which is applied to a payment
View Full Code Here

    assert qc.compareTo(BigDecimal.ZERO) >= 0 && qc.compareTo(BigDecimal.ONE) <= 0;
    assert qe.compareTo(BigDecimal.ZERO) >= 0 && qe.compareTo(BigDecimal.ONE) <= 0;
    assert ql.compareTo(BigDecimal.ZERO) >= 0 && ql.compareTo(BigDecimal.ONE) <= 0;

    BigDecimal result = qt;
    result = result.multiply(qc, MathContext.DECIMAL32);
    result = result.multiply(qe, MathContext.DECIMAL32);
    result = result.multiply(ql, MathContext.DECIMAL32);
    assert result.compareTo(BigDecimal.ZERO) >= 0 && result.compareTo(BigDecimal.ONE) <= 0;

    long round5 = result.scaleByPowerOfTen(5).longValue();
View Full Code Here

    assert qe.compareTo(BigDecimal.ZERO) >= 0 && qe.compareTo(BigDecimal.ONE) <= 0;
    assert ql.compareTo(BigDecimal.ZERO) >= 0 && ql.compareTo(BigDecimal.ONE) <= 0;

    BigDecimal result = qt;
    result = result.multiply(qc, MathContext.DECIMAL32);
    result = result.multiply(qe, MathContext.DECIMAL32);
    result = result.multiply(ql, MathContext.DECIMAL32);
    assert result.compareTo(BigDecimal.ZERO) >= 0 && result.compareTo(BigDecimal.ONE) <= 0;

    long round5 = result.scaleByPowerOfTen(5).longValue();
    result = BigDecimal.valueOf(round5, 5);
View Full Code Here

    assert ql.compareTo(BigDecimal.ZERO) >= 0 && ql.compareTo(BigDecimal.ONE) <= 0;

    BigDecimal result = qt;
    result = result.multiply(qc, MathContext.DECIMAL32);
    result = result.multiply(qe, MathContext.DECIMAL32);
    result = result.multiply(ql, MathContext.DECIMAL32);
    assert result.compareTo(BigDecimal.ZERO) >= 0 && result.compareTo(BigDecimal.ONE) <= 0;

    long round5 = result.scaleByPowerOfTen(5).longValue();
    result = BigDecimal.valueOf(round5, 5);
    assert result.compareTo(BigDecimal.ZERO) >= 0 && result.compareTo(BigDecimal.ONE) <= 0;
View Full Code Here

      // get text for ip1::total
      BigDecimal total = ip1.getTotal();
      LexEngine le = new LexEnginePL();
     
      long integerPart = total.longValue();
      long digitsPart = total.multiply(new BigDecimal(100d)).remainder(new BigDecimal(100d)).longValue();
     
      invoice.setHrTotalIntegerPart(le.getTextForNumber(integerPart));
      invoice.setHrTotalDigitsPart(le.getTextForNumber(digitsPart));
     
      if (logger.isDebugEnabled()) {
View Full Code Here

      // get text for ip1::total
      BigDecimal total = ip1.getTotal();
      LexEngine le = new LexEnginePL();
     
      long integerPart = total.longValue();
      long digitsPart = total.multiply(new BigDecimal(100d)).remainder(new BigDecimal(100d)).longValue();
     
      invoice.setHrTotalIntegerPart(le.getTextForNumber(integerPart));
      invoice.setHrTotalDigitsPart(le.getTextForNumber(digitsPart));
     
      if (logger.isDebugEnabled()) {
View Full Code Here

      BigDecimal r = NMB_0;
      BigDecimal r__1 = NMB_0;
      int i = 0;
      BigDecimal p = NMB__1;

      p = p.multiply(NMB__1);

      _INT_ITERATIONS_ = 0;
      boolean more = true;
      while (more)
      {
View Full Code Here

      {
         r__1 = r;

         int i_x2_p1 = 2 * i + 1;
         r = r.add(
                 (p.multiply(angle.pow(i_x2_p1))).divide(fact(i_x2_p1), scale, java.math.RoundingMode.FLOOR));
         p = p.multiply(NMB__1);
         i++;

         if (++_INT_ITERATIONS_ >= _INT_MAX_ITERATIONS_)
         {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.