diff --git a/src/java/org/apache/poi/ss/formula/functions/Complex.java b/src/java/org/apache/poi/ss/formula/functions/Complex.java index 1e0bd5bfd..4674b8baf 100644 --- a/src/java/org/apache/poi/ss/formula/functions/Complex.java +++ b/src/java/org/apache/poi/ss/formula/functions/Complex.java @@ -104,7 +104,7 @@ public class Complex extends Var2or3ArgFunction implements FreeRefFunction { StringBuffer strb = new StringBuffer(""); if (realNum != 0) { if (isDoubleAnInt(realNum)) { - strb.append(new Double(realNum).intValue()); + strb.append((int)realNum); } else { strb.append(realNum); } diff --git a/src/java/org/apache/poi/ss/formula/functions/Rept.java b/src/java/org/apache/poi/ss/formula/functions/Rept.java index 0dbb189cd..0c8a5f876 100644 --- a/src/java/org/apache/poi/ss/formula/functions/Rept.java +++ b/src/java/org/apache/poi/ss/formula/functions/Rept.java @@ -59,7 +59,7 @@ public class Rept extends Fixed2ArgFunction { return ErrorEval.VALUE_INVALID; } - int numberOfTimeInt = new Double(numberOfTime).intValue(); + int numberOfTimeInt = (int)numberOfTime; StringBuffer strb = new StringBuffer(strText1.length() * numberOfTimeInt); for(int i = 0; i < numberOfTimeInt; i++) { strb.append(strText1);