svn commit: r541209 - in /ofbiz/trunk/framework: webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java widget/src/org/ofbiz/widget/form/ModelFormField.java

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

svn commit: r541209 - in /ofbiz/trunk/framework: webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java widget/src/org/ofbiz/widget/form/ModelFormField.java

jacopoc
Author: jacopoc
Date: Thu May 24 00:11:12 2007
New Revision: 541209

URL: http://svn.apache.org/viewvc?view=rev&rev=541209
Log:
Applied patch from Scott Gray as a temp fix to disable all the roundings done in the ui.
This will help to expose all the processes where rounding should be better handled.

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java?view=diff&rev=541209&r1=541208&r2=541209
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java Thu May 24 00:11:12 2007
@@ -115,12 +115,12 @@
                         BeanModel req = (BeanModel) env.getVariable("request");
                         if (req != null) {
                             HttpServletRequest request = (HttpServletRequest) req.getWrappedObject();
-                            out.write(UtilFormatOut.formatCurrency(amount, isoCode, UtilHttp.getLocale(request)));
+                            out.write(UtilFormatOut.formatCurrency(amount, isoCode, UtilHttp.getLocale(request), 10)); // we set the max to 10 digits as an hack to not round numbers in the ui
                         } else {
-                            out.write(UtilFormatOut.formatCurrency(amount, isoCode, env.getLocale()));
+                            out.write(UtilFormatOut.formatCurrency(amount, isoCode, env.getLocale(), 10)); // we set the max to 10 digits as an hack to not round numbers in the ui
                         }
                     } else {
-                        out.write(UtilFormatOut.formatCurrency(amount.doubleValue(), isoCode, new Locale(locale)));
+                        out.write(UtilFormatOut.formatCurrency(amount.doubleValue(), isoCode, new Locale(locale), 10)); // we set the max to 10 digits as an hack to not round numbers in the ui
                     }
                 } catch (TemplateModelException e) {
                     throw new IOException(e.getMessage());

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?view=diff&rev=541209&r1=541208&r2=541209
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Thu May 24 00:11:12 2007
@@ -1752,7 +1752,7 @@
                 }
                 try {
                     Double parsedRetVal = (Double) ObjectType.simpleTypeConvert(retVal, "Double", null, locale, false);
-                    retVal = UtilFormatOut.formatCurrency(parsedRetVal, isoCode, locale);
+                    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 (GeneralException e) {
                     String errMsg = "Error formatting currency value [" + retVal + "]: " + e.toString();
                     Debug.logError(e, errMsg, module);