What do you think about the attached patch?
I really think it should be committed to the trunk, especially after reading the following notes:

http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(double)

However, I'd like to get feedback from you before committing it since it is a low level change.

Jacopo

PS: thanks to Martin Anderson from the patch and research around it.
Index: framework/entity/src/org/ofbiz/entity/GenericEntity.java
===================================================================
--- framework/entity/src/org/ofbiz/entity/GenericEntity.java    (revisione 
576353)
+++ framework/entity/src/org/ofbiz/entity/GenericEntity.java    (copia locale)
@@ -588,7 +588,7 @@
         // NOTE: for things to generally work properly BigDecimal should 
really be used as the java-type in the field type def XML files
         Object value = get(name);
         if (value instanceof Double) {
-            return new BigDecimal(((Double) value).doubleValue());
+            return new BigDecimal(((Double) value).toString());
         } else {
             return (BigDecimal) get(name);
         }

Reply via email to