Examples of toPlainString()


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

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

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

      return null;
    }
    if (val instanceof BigDecimal && hfsType == HCatFieldSchema.Type.STRING) {
      BigDecimal bd = (BigDecimal) val;
      if (bigDecimalFormatString) {
        return bd.toPlainString();
      } else {
        return bd.toString();
      }
    }
    Number n = (Number) val;
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

      String str = null;
      // TF:Mar 18, 2010:Changed these to use the constant
      BigDecimal result = BigDecimal.ZERO;
      if (source1.compareTo(BigDecimal.ZERO) > 0 ) {
           result = source1.divide(source2, scale+2, RoundingMode.HALF_UP);
           str = result.toPlainString();
           int dotindex = str.indexOf('.') + 1;
           String resultString = str.substring(0,(dotindex+scale));
           result = new BigDecimal(resultString);          
      }else{
        result = source1;
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

            }catch( Exception e ){
                //e.printStackTrace();
            }
        }else if( toType == String.class ){
          BigDecimal value = (BigDecimal)o;
            return value.toPlainString();
        }
        return null;
    }

}
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

      String str = null;
      // TF:Mar 18, 2010:Changed these to use the constant
      BigDecimal result = BigDecimal.ZERO;
      if (source1.compareTo(BigDecimal.ZERO) > 0 ) {
           result = source1.divide(source2, scale+2, RoundingMode.HALF_UP);
           str = result.toPlainString();
           int dotindex = str.indexOf('.') + 1;
           String resultString = str.substring(0,(dotindex+scale));
           result = new BigDecimal(resultString);          
      }else{
        result = source1;
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

      String str = null;
      // TF:Mar 18, 2010:Changed these to use the constant
      BigDecimal result = BigDecimal.ZERO;
      if (source1.compareTo(BigDecimal.ZERO) > 0 ) {
           result = source1.divide(source2, scale+2, RoundingMode.HALF_UP);
           str = result.toPlainString();
           int dotindex = str.indexOf('.') + 1;
           String resultString = str.substring(0,(dotindex+scale));
           result = new BigDecimal(resultString);          
      }else{
        result = source1;
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

      String str = null;
      // TF:Mar 18, 2010:Changed these to use the constant
      BigDecimal result = BigDecimal.ZERO;
      if (source1.compareTo(BigDecimal.ZERO) > 0 ) {
           result = source1.divide(source2, scale+2, RoundingMode.HALF_UP);
           str = result.toPlainString();
           int dotindex = str.indexOf('.') + 1;
           String resultString = str.substring(0,(dotindex+scale));
           result = new BigDecimal(resultString);          
      }else{
        result = source1;
View Full Code Here

Examples of java.math.BigDecimal.toPlainString()

            try {
                // BigDecimal constructor can choke on commas (aka grouping separator)
                string = _canonicalizeExponentialBigDecimal (string, fmt);
               
                BigDecimal parsedBigDecimal = new BigDecimal(string);
                String parsedString = parsedBigDecimal.toPlainString();
                DecimalFormat canonicalExponentialFormat =
                        acquireDecimalFormat(Locale.ENGLISH);
                return BigDecimalFormatter.parseBigDecimal(parsedString,
                                                           canonicalExponentialFormat);
            }
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.