forgot another contains call ...

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1735349 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2016-03-16 23:40:00 +00:00
parent ee4b65394f
commit fc83bdaf9e

View File

@ -641,14 +641,14 @@ public class CellNumberFormatter extends CellFormatter {
// New we check to see if we should remove the integer part
boolean numNoZero = !hasChar('0', numeratorSpecials);
boolean intNoZero = !hasChar('0', integerSpecials);
boolean intOnlyHash = integerSpecials.isEmpty() || (integerSpecials.size() == 1 && integerSpecials.contains('#'));
boolean intOnlyHash = integerSpecials.isEmpty() || (integerSpecials.size() == 1 && hasChar('#', integerSpecials));
boolean removeBecauseZero = fractional == 0 && (intOnlyHash || numNoZero);
boolean removeBecauseFraction = fractional != 0 && intNoZero;
if (value == 0 && (removeBecauseZero || removeBecauseFraction)) {
Special start = lastSpecial(integerSpecials);
boolean hasPlaceHolder = integerSpecials.contains('?') || numeratorSpecials.contains('?');
boolean hasPlaceHolder = hasChar('?', integerSpecials, numeratorSpecials);
CellNumberStringMod sm = hasPlaceHolder
? replaceMod(start, true, numerator, false, ' ')
: deleteMod(start, true, numerator, false);