java poi 导入时,cell取数字值,如果celltype = FORMULA,强制转换为 celltype = STRING,然后进行取值,会可能导致精度丢失
示例:
if (cell.getCellTypeEnum() == CellType.FORMULA) {
cell.setCellType(CellType.STRING);
String stringCellValue = cell.getStringCellValue();
}
这时候stringCellValue 有可能精度丢失
正确:
if (cell.getCellTypeEnum() == CellType.FORMULA) {
stringCellValue = NumberToTextConverter.toText(cell.getNumericCellValue());
}
阿里开源的easyexcel 框架更好用一些