Author: jonesde
Date: Mon Sep 17 19:09:09 2007
New Revision: 576660
URL:
http://svn.apache.org/viewvc?rev=576660&view=revLog:
Changed to use BigDecimal.valueOf instead of constructor, for something closer to the expected results; thanks to Jacopo and Martin Anderson for comments on this
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java?rev=576660&r1=576659&r2=576660&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java Mon Sep 17 19:09:09 2007
@@ -588,9 +588,9 @@
// 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 BigDecimal.valueOf(((Double) value).doubleValue());
} else {
- return (BigDecimal) get(name);
+ return (BigDecimal) value;
}
}