Bug 65190 - Wrong formatting when format starts with0#
Summary: Wrong formatting when format starts with0#
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 5.0.0-FINAL
Hardware: PC
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-16 15:59 UTC by JDM
Modified: 2021-03-16 15:59 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JDM 2021-03-16 15:59:48 UTC
DataFormatter formatter = new HSSFDataFormatter(Locale.ENGLISH);

// Ok
Assert.assertEquals("12334567890123", formatter.formatRawCellContents(12334567890123.0, 0, "0"));

// Ok
Assert.assertEquals("12334567890123", 
formatter.formatRawCellContents(12334567890123.0, 0, "#"));

// Ok
Assert.assertEquals("12334567890123", formatter.formatRawCellContents(12334567890123.0, 0, "#0"));

// Fails  expected:<1[233456789012]3> but was:<1[.23346E1]3>
Assert.assertEquals("12334567890123", formatter.formatRawCellContents(12334567890123.0, 0, "0#"));