thinkanotherone
thinkanotherone

Reputation: 3145

POI Excel - Text cell that contains Numerical value is being recognized as Numerical Cell

If I put number (like 2009, 345) into a Excel cell, I changed the Cell Format to "Text". When I use POI to read that cell, it still thinks it is a numerical cell.

Anyone had the same issue ? I am on POI 3.8.

Thanks !

Upvotes: 0

Views: 2156

Answers (1)

Gagravarr
Gagravarr

Reputation: 48326

POI isn't magic, it'll give you back what the excel file says is there!

In many cases, if you put a number into a cell, Excel will write that to the file as a number with formatting.

If you want a String back of what Excel displays, use DataFormatter to have the number formatted as per the styling rules on the cell

Upvotes: 1

Related Questions