Examples of toPlainString()


Examples of java.math.BigDecimal.toPlainString()

                throws ParseException
        {
            BigDecimal exponentialAmount = matcher.getAmount();
            String exponentialString = matcher.getExponentialString();
            String completeExponentialString = StringUtil.strcat(
                exponentialAmount.toPlainString(), exponentialString);
            DecimalParseInfo exponentialInfo =
                parseExponentialBigDecimal(completeExponentialString, fmt);
            String exponentialPrefixString = matcher.getPrefixString();
            String exponentialSuffixString = matcher.getSuffixString();
            return new DecimalParseInfo(exponentialInfo.integerDigits,
View Full Code Here

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()

        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()

  }

  public String  getString()
  {
    BigDecimal localValue = getBigDecimal();
        return (localValue == null) ? null : localValue.toPlainString();
  }

  public Object  getObject()
  {
    /*
 
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

                        }
                        responseWriter.println("</table>\n");
                    }
                }
                // Print overall score for student and close the row
                reportWriter.println("<td>" + overallScore.toPlainString() + "</td></tr>");
                // Close the Student Response Report if it's open
                if (saveResponses)
                {
                    responseWriter.println("<p><a href=\"../"
                            + sReport.getSection().getName()
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()

                    assertEquals(compDecimal, compString);
                }
            }
            BigDecimal test = DecimalField.stringToDecimal(s);
            if (test.compareTo(d) != 0) {
                assertEquals(d + "<>" + test.toPlainString(), 0, test.compareTo(d));
            }
            lastDecimal = d;
            lastString = s;
        }
    }
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

                assertEquals(msg, getExpected(avgTypes[k]), l);
            } else if (inputType == "BigDecimal") {
                BigDecimal f1 = (BigDecimal)((Tuple)output).get(0);
                String msg = "[Testing " + avgTypes[k] + " on input type: " + getInputType(avgTypes[k]) + " ( (output) " +
                               f1 + " == " + getExpected(avgTypes[k]) + " (expected) )]";
                assertEquals(msg, ((BigDecimal)getExpected(avgTypes[k])).toPlainString(), f1.toPlainString());
            } else if (inputType == "BigInteger") {
                BigInteger f1 = (BigInteger)((Tuple)output).get(0);
                String msg = "[Testing " + avgTypes[k] + " on input type: " + getInputType(avgTypes[k]) + " ( (output) " +
                               f1 + " == " + getExpected(avgTypes[k]) + " (expected) )]";
                assertEquals(msg, ((BigInteger)getExpected(avgTypes[k])).toString(), f1.toString());
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

                assertEquals(msg, (Double)getExpected(avgTypes[k]), f1, 0.00001);
            }
            if (inputType == "BigDecimal") {
                BigDecimal f2 = (BigDecimal)((Tuple)output).get(1);
                assertEquals("[Testing " + avgTypes[k] + " on input type: "+
                    inputType+"]Expected count to be 4", "4", f2.toPlainString());

            } else if (inputType == "BigInteger") {
                BigInteger f2 = (BigInteger)((Tuple)output).get(1);
                assertEquals("[Testing " + avgTypes[k] + " on input type: "+
                    inputType+"]Expected count to be 4", "4", f2.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.