commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hen...@apache.org
Subject svn commit: r1067104 - /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java
Date Fri, 04 Feb 2011 07:43:59 GMT
Author: henrib
Date: Fri Feb  4 07:43:59 2011
New Revision: 1067104

URL: http://svn.apache.org/viewvc?rev=1067104&view=rev
Log:
JEXL-106: forgot a big decimal conversion

Modified:
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java?rev=1067104&r1=1067103&r2=1067104&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl2/JexlArithmetic.java Fri
Feb  4 07:43:59 2011
@@ -764,13 +764,13 @@ public class JexlArithmetic {
             controlNullOperand();
             return BigDecimal.ZERO;
         } else if (val instanceof String) {
-            String string = (String) val;
-            if ("".equals(string.trim())) {
+            String string = ((String) val).trim();
+            if ("".equals(string)) {
                 return BigDecimal.valueOf(0);
             }
-            return new BigDecimal(string);
+            return new BigDecimal(string, mathContext);
         } else if (val instanceof Number) {
-            return new BigDecimal(val.toString());
+            return new BigDecimal(val.toString(), mathContext);
         } else if (val instanceof Character) {
             int i = ((Character) val).charValue();
             return new BigDecimal(i);



Mime
View raw message