From: Nick Burch Date: Fri, 13 Jan 2012 16:03:17 +0000 (+0000) Subject: Correct fraction formatting quick return logic X-Git-Tag: REL_3_8_FINAL~82 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5588a1c1368b92ea4891bf908dd5bd0ff60ad519;p=poi.git Correct fraction formatting quick return logic git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1231144 13f79535-47bb-0310-9956-ffa450edef68 --- 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"; }