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
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...
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!)