svn commit: r778351 - /ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r778351 - /ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java

mor-2
Author: mor
Date: Mon May 25 08:36:50 2009
New Revision: 778351

URL: http://svn.apache.org/viewvc?rev=778351&view=rev
Log:
Reported by Hans on dev list the correct usage of BigDecimal.

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java?rev=778351&r1=778350&r2=778351&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java Mon May 25 08:36:50 2009
@@ -424,7 +424,7 @@
                     newEstimatedShipCost = newEstimatedShipCost.add(shipment.getBigDecimal("additionalShippingCharge"));
                 }
             }
-            if (estimatedShipCost.equals(ZERO)) {
+            if (estimatedShipCost.compareTo(ZERO) == 0) {
                 diffInShipCostInPerc = newEstimatedShipCost;
             } else {
                 diffInShipCostInPerc = (((newEstimatedShipCost.subtract(estimatedShipCost)).divide(estimatedShipCost, 2, rounding)).multiply(new BigDecimal(100))).abs();