From 5588a1c1368b92ea4891bf908dd5bd0ff60ad519 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 13 Jan 2012 16:03:17 +0000 Subject: [PATCH] Correct fraction formatting quick return logic 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java/org/apache/poi/ss/usermodel/DataFormatter.java b/src/java/org/apache/poi/ss/usermodel/DataFormatter.java index c041e32376..3f09aafa2b 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"; } -- 2.39.5