Commit 0c29c0f5 authored by steurwadkar's avatar steurwadkar

Changes made to format double to 2 digit

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@178694 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7eb0269e
...@@ -26,6 +26,7 @@ public class PricelistGenEJB extends ValidatorEJB ...@@ -26,6 +26,7 @@ public class PricelistGenEJB extends ValidatorEJB
{ {
E12GenericUtility genericUtility= new E12GenericUtility(); E12GenericUtility genericUtility= new E12GenericUtility();
DistCommon distCommon = new DistCommon(); DistCommon distCommon = new DistCommon();
DecimalFormat df = new DecimalFormat("#.00");
public Object generateAndInsertPriceList(String productCode, ArrayList<HashMap<String, String>> targetPlist, String effFrom, String validUpto, String xtraParams, boolean isPreview, Connection conn) throws RemoteException,ITMException public Object generateAndInsertPriceList(String productCode, ArrayList<HashMap<String, String>> targetPlist, String effFrom, String validUpto, String xtraParams, boolean isPreview, Connection conn) throws RemoteException,ITMException
{ {
...@@ -240,6 +241,10 @@ public class PricelistGenEJB extends ValidatorEJB ...@@ -240,6 +241,10 @@ public class PricelistGenEJB extends ValidatorEJB
} }
System.out.println("itemCode ["+itemCode+"] priceList["+priceListTar+"] finalRate["+finalRate+"]"); System.out.println("itemCode ["+itemCode+"] priceList["+priceListTar+"] finalRate["+finalRate+"]");
finalRate = df.format(Double.valueOf(finalRate));
System.out.println("finalRate after formatting["+finalRate+"]");
HashMap<String, String> eachPlistInsHMap = new HashMap<String, String>(); HashMap<String, String> eachPlistInsHMap = new HashMap<String, String>();
eachPlistInsHMap.put("price_list", priceListTar); eachPlistInsHMap.put("price_list", priceListTar);
eachPlistInsHMap.put("price_list_parent", priceListParnt); eachPlistInsHMap.put("price_list_parent", priceListParnt);
...@@ -468,7 +473,6 @@ public class PricelistGenEJB extends ValidatorEJB ...@@ -468,7 +473,6 @@ public class PricelistGenEJB extends ValidatorEJB
private double getDoubleValue(String input) throws Exception private double getDoubleValue(String input) throws Exception
{ {
double value = 0.0; double value = 0.0;
DecimalFormat df = new DecimalFormat("#.00");
try try
{ {
if(input == null) if(input == null)
...@@ -480,9 +484,9 @@ public class PricelistGenEJB extends ValidatorEJB ...@@ -480,9 +484,9 @@ public class PricelistGenEJB extends ValidatorEJB
if(input.trim().length() > 0) if(input.trim().length() > 0)
{ {
value = Double.valueOf(E12GenericUtility.checkNull(input)); value = Double.valueOf(E12GenericUtility.checkNull(input));
String roundValue = df.format(value); /*String roundValue = df.format(value);
System.out.println("formatted value = ["+roundValue+"]"); System.out.println("formatted value = ["+roundValue+"]");
value = Double.parseDouble(roundValue); value = Double.parseDouble(roundValue);*/
} }
} }
System.out.println("retutn value["+value+"]"); System.out.println("retutn value["+value+"]");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment