防止Excel中数字变成科学计数法
DecimalFormat df = new DecimalFormat(“0”);
cellValue = df.format(cell.getNumericCellValue());
public static Object getCellFormatValue(Cell cell){
Object cellValue = null;
if(cell!=null){
//判断cell类型
switch(cell.getCellType()){
case Cell.CELL_TYPE_NUMERIC:{
防止变成科学计数法
DecimalFormat df = new DecimalFormat("0");
cellValue = df.format(cell.getNumericCellValue());
//转换成字符串
cellValue = String.valueOf(cellValue);
break;
}
}else{
cellValue = "";
}
return cellValue;
}