问题
Is there any way I can get to the formatted value that excel shows in a row, versus the raw value I am getting returned from the stream?
Or would this fall under the "formula evaluation" category, which this does not support?
回答1:
If you have the Cell
that you're trying to get the data out of, try the following
DataFormatter formatter = new DataFormatter();
String formattedCellValue = formatter.formatCellValue(myCell);
If that doesn't get exactly what you're looking for, there are a number of different methods in the DataFormatter
class that do the trick. Check out the API.
来源:https://stackoverflow.com/questions/18237828/apache-poi-xssf-read-formatted-cell-value