svn commit: r811813 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java

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

svn commit: r811813 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java

lektran
Author: lektran
Date: Sun Sep  6 11:24:57 2009
New Revision: 811813

URL: http://svn.apache.org/viewvc?rev=811813&view=rev
Log:
Applied a slightly modified fix from Eric de Maulde (OFBIZ-2757), the currency transform for FreeMarker was not permitting rounding to 0 decimal places

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.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?rev=811813&r1=811812&r2=811813&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizCurrencyTransform.java Sun Sep  6 11:24:57 2009
@@ -90,7 +90,7 @@
 
             // handle nulls better
             if (o == null) {
-                o = 0;
+                return null;
             }
 
             if (o instanceof NumberModel) {
@@ -107,7 +107,7 @@
             }
             return Integer.valueOf(o.toString());
         }
-        return 0;
+        return null;
     }
 
     public Writer getWriter(final Writer out, Map args) {
@@ -120,8 +120,8 @@
         // check the rounding -- DEFAULT is 10 to not round for display, only use this when necessary
         // rounding should be handled by the code, however some times the numbers are coming from
         // someplace else (i.e. an integration)
-        int roundingNumber = getInteger(args, "rounding");
-        if (roundingNumber == 0) roundingNumber = 10;
+        Integer roundingNumber = getInteger(args, "rounding");
+        if (roundingNumber == null) roundingNumber = 10;
         final int rounding = roundingNumber;
 
         return new Writer(out) {