Author: adrianc
Date: Sat Jan 10 07:23:18 2009
New Revision: 733283
URL:
http://svn.apache.org/viewvc?rev=733283&view=revLog:
Fixed bug introduced by recent Double to BigDecimal refactor - reported on user mailing list.
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=733283&r1=733282&r2=733283&view=diff==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Sat Jan 10 07:23:18 2009
@@ -2058,9 +2058,9 @@
isoCode = this.currency.expandString(context);
}
try {
- BigDecimal parsedRetVal = new BigDecimal(retVal);
+ BigDecimal parsedRetVal = (BigDecimal) ObjectType.simpleTypeConvert(retVal, "BigDecimal", null, null, locale, true);
retVal = UtilFormatOut.formatCurrency(parsedRetVal, isoCode, locale, 10); // we set the max to 10 digits as an hack to not round numbers in the ui
- } catch (NumberFormatException e) {
+ } catch (GeneralException e) {
String errMsg = "Error formatting currency value [" + retVal + "]: " + e.toString();
Debug.logError(e, errMsg, module);
throw new IllegalArgumentException(errMsg);