So far I have the following:

Cell H:2 in Excel Spreadsheet contains value 12312345123
Cell H:2 in Excel Spreadsheet has custom format 000-00000-000

I look at styles.xml and confirm the format is there:

     <numFmt formatCode="000\-00000\-000" numFmtId="164"/>

When I read this cell using 3.8 beta 5...

I create my DataFormatter and FormulaEvaluator

     DataFormatter formatter = new DataFormatter();
     FormulaEvaluator evaluator =
workbook.getCreationHelper().createFormulaEvaluator();

Then I obtain the cell in question...

     cell.getCellStyle().getDataFormatString() returns "000\-00000\-000" 
     cell.getCellStyle().getDataFormat() returns 164

Correct and correct. But...

     formatter.formatCellValue(cell) returns "12312345123"

Any ideas? Thanks again. 

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Reading-cell-values-that-have-a-custom-format-tp5486315p5489483.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to