Summary: | After setting a cell to String type, the result of getStringCellValue for some certain format cells is not right | ||
---|---|---|---|
Product: | POI | Reporter: | jwang |
Component: | POI Overall | Assignee: | POI Developers List <dev> |
Status: | RESOLVED INVALID | ||
Severity: | critical | ||
Priority: | P2 | ||
Version: | 3.9-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
jwang
2013-12-12 21:33:16 UTC
Calling cell.setCellType(Cell.CELL_TYPE_STRING) will change the low level type of the cell, as stored in the file. POI will try to convert the type in a basic way for you, which is what you're seeing. If you want full control over how the number becomes a string, fetch the number, apply your own rules, then set the resulting string. If you just want to get a string holding the number as formatted in Excel, you'll need to use DataFormatter. |