答案与我在这里给出的答案相同:
POI为您提供Excel已存储在文件中的确切值。通常,如果您在Excel单元格中写入数字,Excel会将其存储为带有格式的数字。POI为您提供了格式化所需的支持(大多数人不愿意-
他们希望数字为数字,以便他们可以使用它们)
您要查找的类是DataFormatter。您的代码将类似于
DataFormatter fmt = new DataFormatter(); for (Row r : sheet) { for (Cell c : r) { CellReference cr = new CellRefence(c); System.out.println("Cell " + cr.formatAsString() + " is " + fmt.formatCellValue(c) ); } }


