You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2020/04/07 08:33:20 UTC
[Bug 64319] New: DataFormatter on conditional format with E in adds
a +
https://bz.apache.org/bugzilla/show_bug.cgi?id=64319
Bug ID: 64319
Summary: DataFormatter on conditional format with E in adds a +
Product: POI
Version: unspecified
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: SS Common
Assignee: dev@poi.apache.org
Reporter: david.sheldon@mindfoundry.ai
Target Milestone: ---
If you have a number format which ends up with an "E" in it, this is replaced
by "E+"
If my formatString is "TRUE";"TRUE";"FALSE", I'd expect all non-zero values to
be "TRUE", however they are "TRUE+".
This test fails:
@Test
public void testBaseFormattingTrue() {
DataFormatter formatter = new DataFormatter();
assertThat(formatter.formatRawCellContents(1.0, 170,
"\"TRUE\";\"TRUE\";\"FALSE\"")).isEqualTo("TRUE");
}
and
System.out.println(formatter.formatRawCellContents(1.0, 170,
"\"POSITIVE\";\"NEGATIVE\";\"ZERO\""));
System.out.println(formatter.formatRawCellContents(-1.0, 170,
"\"POSITIVE\";\"NEGATIVE\";\"ZERO\""));
System.out.println(formatter.formatRawCellContents(0, 170,
"\"POSITIVE\";\"NEGATIVE\";\"ZERO\""));
prints:
POSITIVE+
NE+GATIVE
ZE+RO
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 64319] DataFormatter on conditional format with E in adds a +
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64319
Nick Burch <ap...@gagravarr.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
This does look like a bug
I've added a more comprehensive unit test in r1876225 which should cover all
the various E cases, most of which we are currently failing on...
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 64319] DataFormatter on conditional format with E in adds a +
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64319
Nick Burch <ap...@gagravarr.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #2 from Nick Burch <ap...@gagravarr.org> ---
Hopefully fixed in r1876396.
I have changed the code that adds the + to #e# for 0E+0 so that it checks that
it is a format type that needs that change. I've also added unit tests and a
few tweaks for some other scientific / exponential formats which don't need the
change. (Another case where Excel and Java have different formatting rules,
fun!)
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org