From 6c37e2c672a7dc5ac7047b8cf649d48a71c3e1c3 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 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"; }