Examples of movePointLeft()


Examples of java.math.BigDecimal.movePointLeft()

        if (targetScale < 0) {
            throw DbException.getInvalidValueException("scale", targetScale);
        }
        long n = nanos;
        BigDecimal bd = BigDecimal.valueOf(n);
        bd = bd.movePointLeft(9);
        bd = ValueDecimal.setScale(bd, targetScale);
        bd = bd.movePointRight(9);
        long n2 = bd.longValue();
        if (n2 == n) {
            return this;
View Full Code Here

Examples of java.math.BigDecimal.movePointLeft()

        if (targetScale < 0) {
            throw JdbcException.getInvalidValueException("scale", targetScale);
        }
        long n = nanos;
        BigDecimal bd = BigDecimal.valueOf(n);
        bd = bd.movePointLeft(9);
        bd = MathUtils.setScale(bd, targetScale);
        bd = bd.movePointRight(9);
        long n2 = bd.longValue();
        if (n2 == n) {
            return this;
View Full Code Here

Examples of java.math.BigDecimal.movePointLeft()

                rentalValue = rentalValue.add(getReserv2ndPPPerc());
            }
        }
        rentalValue = rentalValue.add(new BigDecimal("100"));    // add final 100 percent for first person
        //     Debug.log("rental parameters....Nbr of persons:" + getReservPersons() + " extra% 2nd person:" + getReserv2ndPPPerc()+ " extra% Nth person:" + getReservNthPPPerc() + "  total rental adjustment:" + rentalValue/100 * getReservLength() );
        return rentalValue.movePointLeft(2).multiply(getReservLength()); // return total rental adjustment
    }

    /** Returns the total line price. */
    public BigDecimal getItemSubTotal(BigDecimal quantity) {
//        Debug.logInfo("Price" + getBasePrice() + " quantity" +  quantity + " Rental adj:" + getRentalAdjustment() + " other adj:" + getOtherAdjustments(), module);
View Full Code Here

Examples of java.math.BigDecimal.movePointLeft()

    public BigDecimal getAmount(String amount) {
        if (amount == null) {
            return new BigDecimal("0.00");
        }
        BigDecimal amountBd = new BigDecimal(amount);
        return amountBd.movePointLeft(2);
    }

    public String getCurrency(String currency) {
        return "840"; // todo make this multi-currency
    }
View Full Code Here

Examples of java.math.BigDecimal.movePointLeft()

                try {
                    amount = new BigDecimal(value);
                } catch (NumberFormatException e) {
                }

                amount = amount.movePointLeft(2).negate();
                trans.addDiscount(null, amount, percent);
                trans.calcTax();
            }
        }
        pos.refresh();
View Full Code Here

Examples of java.math.BigDecimal.movePointLeft()

                try {
                    amount = new BigDecimal(value);
                } catch (NumberFormatException e) {
                }

                amount = amount.movePointLeft(2).negate();
                trans.addDiscount(sku, amount, percent);
                trans.calcTax();
            }
        }
        pos.refresh();
View Full Code Here

Examples of java.math.BigDecimal.movePointLeft()

                    Debug.logError("Invalid number for amount : " + amtStr, module);
                    pos.getOutput().print("Invalid Amount!");
                    input.clearInput();
                    throw new GeneralException();
                }
                amount = amount.movePointLeft(2); // convert to decimal
                Debug.log("Set amount / 100 : " + amount, module);
            } else {
                Debug.log("Amount is empty; assumption is full amount : " + trans.getTotalDue(), module);
                amount = trans.getTotalDue();
                if (amount.compareTo(BigDecimal.ZERO) <= 0) {
View Full Code Here

Examples of java.math.BigDecimal.movePointLeft()

                parsed = true;
            } catch (NumberFormatException e) {
            }

            if (parsed) {
                price = price.movePointLeft(2);
                trans.modifyPrice(sku, price);

                // re-calc tax
                trans.calcTax();
            }
View Full Code Here

Examples of java.math.BigDecimal.movePointLeft()

                BigDecimal amt = ZERO;
                String amountStr = input.value();
                if (UtilValidate.isNotEmpty(amountStr)) {
                    try {
                        amt = new BigDecimal(amountStr);
                        amt = amt.movePointLeft(2);
                    } catch (NumberFormatException e)
                    {
                        Debug.logError(e, module);
                    }
                }
View Full Code Here

Examples of java.math.BigDecimal.movePointLeft()

            String lastValue = input.value();
            if (UtilValidate.isNotEmpty(lastValue)) {

                try {
                    BigDecimal amt = new BigDecimal(lastValue);
                    amt = amt.movePointLeft(2);
                    lastValue = amt.toString();
                } catch (NumberFormatException e) {
                    Debug.logError(e, module);
                }
                if (UtilValidate.isNotEmpty(func[1])) {
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.