Examples of toPlainString()


Examples of java.math.BigDecimal.toPlainString()

            }
            // (packageWeight % 1) * 16 (Rounded up to 0 dp)
            BigDecimal weightOunces = packageWeight.remainder(BigDecimal.ONE).multiply(new BigDecimal("16")).setScale(0, BigDecimal.ROUND_CEILING);
           
            UtilXml.addChildElementValue(packageElement, "Pounds", weightPounds.toPlainString(), requestDocument);
            UtilXml.addChildElementValue(packageElement, "Ounces", weightOunces.toPlainString(), requestDocument);

            // TODO: handle other container types, package sizes, and machinable packages
            // IMPORTANT: Express or Priority Mail will fail if you supply a Container tag: you will get a message like
            // Invalid container type. Valid container types for Priority Mail are Flat Rate Envelope and Flat Rate Box.
            /* This is an official response from the United States Postal Service:
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

        Element packagingTypeElement = UtilXml.addChildElement(packageElement, "PackagingType", requestDoc);
        UtilXml.addChildElementValue(packagingTypeElement, "Code", "00", requestDoc);
        UtilXml.addChildElementValue(packagingTypeElement, "Description", "Unknown PackagingType", requestDoc);
        UtilXml.addChildElementValue(packageElement, "Description", "Package Description", requestDoc);
        Element packageWeightElement = UtilXml.addChildElement(packageElement, "PackageWeight", requestDoc);
        UtilXml.addChildElementValue(packageWeightElement, "Weight", packageWeight.toPlainString(), requestDoc);
        //If product is in shippable Package then it we should have one product per packagemap
        if (packageMap.size() ==1) {
            Iterator<String> i = packageMap.keySet().iterator();
            String productId = i.next();
            Map<String, Object> productInfo = ShipmentWorker.getProductItemInfo(shippableItemInfo, productId);
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

        ctx.put("finAccountId", "TESTACCOUNT1");
        ctx.put("amount", new BigDecimal("100.00"));
        ctx.put("userLogin", userLogin);
        Map<String, Object> resp = dispatcher.runSync("finAccountDeposit", ctx);
        BigDecimal balance = (BigDecimal) resp.get("balance");
        assertEquals(balance.toPlainString(), "100.00");
    }

    public void testWithdraw() throws Exception {
        Map<String, Object> ctx = FastMap.newInstance();
        ctx.put("finAccountId", "TESTACCOUNT1");
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

        encoder.add("CURRENCYCODE", orh.getCurrency());
        BigDecimal grandTotal = orh.getOrderGrandTotal();
        BigDecimal shippingTotal = orh.getShippingTotal().setScale(2, BigDecimal.ROUND_HALF_UP);
        BigDecimal taxTotal = orh.getTaxTotal().setScale(2, BigDecimal.ROUND_HALF_UP);
        BigDecimal subTotal = grandTotal.subtract(shippingTotal).subtract(taxTotal).setScale(2, BigDecimal.ROUND_HALF_UP);
        encoder.add("ITEMAMT", subTotal.toPlainString());
        encoder.add("SHIPPINGAMT", shippingTotal.toPlainString());
        encoder.add("TAXAMT", taxTotal.toPlainString());

        NVPDecoder decoder = null;
        try {
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

            transaction.setEntranceCode(EntranceCode);
            transaction.setMerchantReturnURL(returnURL);
            Transaction trx = connector.requestTransaction(transaction);
            redirectString = trx.getIssuerAuthenticationURL();
            request.getSession().setAttribute("purchaseID", orderId);
            request.getSession().setAttribute("payAmount", orderTotal.toPlainString());
        } catch (IdealException ex) {
            Debug.logError(ex.getMessage(), module);
            request.setAttribute("_ERROR_MESSAGE_", ex.getConsumerMessage());
            return "error";
        }
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

            case DATE:
                Date dateValue = dcv.getDateValue();
                return ( dateValue == null ? null : DateUtils.format( dcv.getDateValue() ) );
            case NUMERIC:
                BigDecimal numericValue = (BigDecimal) dcv.getNumericValue();
                return ( numericValue == null ? null : numericValue.toPlainString() );
            case NUMERIC_BIGDECIMAL:
                BigDecimal bigDecimalValue = (BigDecimal) dcv.getNumericValue();
                return ( bigDecimalValue == null ? null : bigDecimalValue.toPlainString() );
            case NUMERIC_BIGINTEGER:
                BigInteger bigIntegerValue = (BigInteger) dcv.getNumericValue();
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

            case NUMERIC:
                BigDecimal numericValue = (BigDecimal) dcv.getNumericValue();
                return ( numericValue == null ? null : numericValue.toPlainString() );
            case NUMERIC_BIGDECIMAL:
                BigDecimal bigDecimalValue = (BigDecimal) dcv.getNumericValue();
                return ( bigDecimalValue == null ? null : bigDecimalValue.toPlainString() );
            case NUMERIC_BIGINTEGER:
                BigInteger bigIntegerValue = (BigInteger) dcv.getNumericValue();
                return ( bigIntegerValue == null ? null : bigIntegerValue.toString() );
            case NUMERIC_BYTE:
                Byte byteValue = (Byte) dcv.getNumericValue();
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

        ctx.put("amount", new BigDecimal("100.00"));
        ctx.put("userLogin", userLogin);
        resp = dispatcher.runSync("finAccountDeposit", ctx);
        assertTrue("Service 'finAccountDeposit' result success", ServiceUtil.isSuccess(resp));
        BigDecimal balance = (BigDecimal) resp.get("balance");
        assertEquals(balance.toPlainString(), "100.00");
        ctx.clear();
        ctx.put("finAccountId", "TESTACCOUNT1");
        ctx.put("amount", new BigDecimal("50.00"));
        ctx.put("userLogin", userLogin);
        resp = dispatcher.runSync("finAccountWithdraw", ctx);
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

        ctx.put("userLogin", userLogin);
        resp = dispatcher.runSync("finAccountWithdraw", ctx);
        assertTrue("Service 'finAccountWithdraw' result success", ServiceUtil.isSuccess(resp));
        BigDecimal previousBalance = (BigDecimal) resp.get("previousBalance");
        balance = ((BigDecimal) resp.get("balance"));
        assertEquals(balance.add(new BigDecimal("50.00")).toPlainString(), previousBalance.toPlainString());
    }
}
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

        for ( int i = 0; i < expected.length; i++ ) {
            DTCellValue52 dcv = actual.get( i );
            switch ( dcv.getDataType() ) {
                case NUMERIC:
                    final BigDecimal numeric = (BigDecimal) dcv.getNumericValue();
                    if ( !expected[ i ].equals( numeric.toPlainString() ) ) {
                        return false;
                    }
                    break;
                case NUMERIC_BIGDECIMAL:
                    final BigDecimal numericBigDecimal = (BigDecimal) dcv.getNumericValue();
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.