diff --git a/src/java/org/apache/poi/ss/usermodel/DataFormatter.java b/src/java/org/apache/poi/ss/usermodel/DataFormatter.java index c041e3237..3f09aafa2 100644 --- a/src/java/org/apache/poi/ss/usermodel/DataFormatter.java +++ b/src/java/org/apache/poi/ss/usermodel/DataFormatter.java @@ -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"; }