From ede439abdcaa0669b18ebea904593ca3c4b5e6e0 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 14 Aug 2021 09:53:38 +0000 Subject: [PATCH] increase intermediate significance git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1892332 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/ss/formula/functions/PercentRank.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/PercentRank.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/PercentRank.java index 1f4530b921..2612f507fa 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/PercentRank.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/PercentRank.java @@ -126,11 +126,12 @@ public final class PercentRank implements Function { BigDecimal result = new BigDecimal((double)lessThanCount / (double)(lessThanCount + greaterThanCount)); return new NumberEval(round(result, significance)); } else { - ValueEval belowRank = calculateRank(numbers, closestMatchBelow, significance + 3, false); + int intermediateSignificance = significance < 5 ? 8 : significance + 3; + ValueEval belowRank = calculateRank(numbers, closestMatchBelow, intermediateSignificance, false); if (!(belowRank instanceof NumberEval)) { return belowRank; } - ValueEval aboveRank = calculateRank(numbers, closestMatchAbove, significance + 3, false); + ValueEval aboveRank = calculateRank(numbers, closestMatchAbove, intermediateSignificance, false); if (!(aboveRank instanceof NumberEval)) { return aboveRank; } -- 2.39.5