You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mo...@apache.org on 2009/05/25 10:36:50 UTC

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

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