Package java.math

Examples of java.math.BigDecimal.subtract()


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

    if (computedResult != null)
View Full Code Here


      submitPayment(to, amount.toString(), getProperty("PAYMENT_ONLY_ONCE_RADIO"));
      assertTrue("Scheduled payment not confirmed.", browser.isTextPresent(MessageFormat.format(getProperty("PAYMENT_CONFIRMATION_MESSAGE"), to)));
      assertEquals("Invalid count of payments.", 1, browser.getXpathCount(getProperty("PAYMENTS_COUNT")));
      browser.click(accountLinkLocator);
      browser.waitForPageToLoad(TIMEOUT);
      assertEquals("No money were subtracted from account", expectedBalance.subtract(amount), BigDecimal.valueOf(parseBalance(browser.getText(accountBalanceLocator))));
   }

   /**
    * Submits new payment with one minute interval and verifies the balance
    * after 60 seconds
View Full Code Here

                        // resulting in IllegalArgumentException when reflective
                        // setter is invoked for incompatible field type
                        // (see http://www.jpox.org/servlet/jira/browse/CORE-2624)
                        Class keyType = om.getApiAdapter().getKeyTypeForSingleFieldIdentityType(field.getType());
                        obj = ClassUtils.convertValue(bigDecimal, keyType);
                        if (!bigDecimal.subtract(new BigDecimal("" + obj)).equals(new BigDecimal("0")))
                        {
                            throw new JPOXException("Cannot convert retrieved BigInteger value to field of object id class!").setFatal();
                        }
                    }
                    // field with multiple columns should have values returned from db merged here
View Full Code Here

                        // resulting in IllegalArgumentException when reflective
                        // setter is invoked for incompatible field type
                        // (see http://www.jpox.org/servlet/jira/browse/CORE-2624)
                        Class keyType = ec.getApiAdapter().getKeyTypeForSingleFieldIdentityType(field.getType());
                        obj = ClassUtils.convertValue(bigDecimal, keyType);
                        if (!bigDecimal.subtract(new BigDecimal("" + obj)).equals(new BigDecimal("0")))
                        {
                            throw new NucleusException("Cannot convert retrieved BigInteger value to field of object id class!").setFatal();
                        }
                    }
                    // field with multiple columns should have values returned from db merged here
View Full Code Here

         i=0;
         while(qty.doubleValue()>0) {
           availVO = (ItemAvailabilityVO)list.get(i);
           if (qty.doubleValue()>availVO.getAvailableQtyWAR03().doubleValue()) {
             delta = availVO.getAvailableQtyWAR03();
             qty = qty.subtract(delta);
           }
           else {
             delta = qty;
             qty = new BigDecimal(0);
           }
View Full Code Here

    if (total != null && paid != null) {
      if (paid.doubleValue() < total.doubleValue()) {
        controlPaid.setValue(null);
        controlChange.setValue(null);
      } else {
        controlChange.setValue(paid.subtract(total));
      }
    }
  }

  void controlDiscount_focusLost(FocusEvent e) {
View Full Code Here

    BigDecimal paid = controlPaid.getBigDecimal();
    if (total!=null && paid!=null) {
      if (paid.doubleValue()<total.doubleValue())
        controlPaid.setValue(null);
      else
        controlChange.setValue(paid.subtract(total));
    }

    detailSaleDocVO.setAllowanceDOC01(discount);
    detailSaleDocVO.setTotalDOC01(total);
    if (!total.setScale(currVO.getDecimalsREG03().intValue(),BigDecimal.ROUND_HALF_UP).equals(
View Full Code Here

            if (tmpResults.get("availableToPromiseTotal") != null) {
                existingAtp = (BigDecimal) tmpResults.get("availableToPromiseTotal");
            }
            // if the order is immediately fulfilled, adjust the atp to compensate for it not reserved
            if (isImmediatelyFulfilled) {
                existingAtp = existingAtp.subtract(orderItem.getBigDecimal("quantity"));
            }

            if (Debug.verboseOn()) { Debug.logVerbose("Order item [" + orderItem + "] Existing ATP = [" + existingAtp + "]", module); }
            // we only need to produce more marketing packages if there isn't enough in stock.
            if (existingAtp.compareTo(ZERO) < 0) {
View Full Code Here

                    BigDecimal remainingQty = (BigDecimal)currentDateMap.get("remainingQty");
                    if (remainingQty.compareTo(ZERO) == 0) {
                        continue;
                    }
                    if (remainingQty.compareTo(quantityNotAvailableRem) >= 0) {
                        remainingQty = remainingQty.subtract(quantityNotAvailableRem);
                        currentDateMap.put("remainingQty", remainingQty);
                        GenericValue orderItemShipGrpInvRes = delegator.findByPrimaryKey("OrderItemShipGrpInvRes",
                                UtilMisc.toMap("orderId", genericResult.getString("orderId"),
                                        "shipGroupSeqId", genericResult.getString("shipGroupSeqId"),
                                        "orderItemSeqId", genericResult.getString("orderItemSeqId"),
View Full Code Here

      int curCodePoint = cur.intValue();
      if (0 == curCodePoint) {
        break;
      }

      cur = cur.subtract(new BigDecimal(curCodePoint));
      sb.append(Character.toChars(curCodePoint));
    }

    return sb.toString();
  }
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.