]> source.dussan.org Git - poi.git/commitdiff
Correct fraction formatting quick return logic
authorNick Burch <nick@apache.org>
Fri, 13 Jan 2012 16:03:17 +0000 (16:03 +0000)
committerNick Burch <nick@apache.org>
Fri, 13 Jan 2012 16:03:17 +0000 (16:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1231144 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/ss/usermodel/DataFormatter.java

index c041e32376f395409e3a364d39fbedb3472dde3f..3f09aafa2b73fa41242a0bea374521c15cbe70b8 100644 (file)
@@ -983,7 +983,7 @@ public class DataFormatter {
        public String format(Number num) {
           double wholePart = Math.floor(num.doubleValue());
           double decPart = num.doubleValue() - wholePart;
-          if (wholePart * decPart == 0) {
+          if (wholePart + decPart == 0) {
              return "0";
           }