Correct fraction formatting quick return logic

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1231144 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2012-01-13 16:03:17 +00:00
parent 24b020cb12
commit 6c37e2c672

View 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";
}