6,210
社区成员
发帖
与我相关
我的任务
分享
case XSSFCell.CELL_TYPE_NUMERIC:
// System.out.println(i+"行"+j+" 列 is Number type ; DateFormt:"+cell.getCellStyle().getDataFormatString());
if("@".equals(cell.getCellStyle().getDataFormatString())){
value = df.format(cell.getNumericCellValue());
} else if("General".equals(cell.getCellStyle().getDataFormatString())){
value = nf.format(cell.getNumericCellValue());
}else{
value = sdf.format(HSSFDateUtil.getJavaDate(cell.getNumericCellValue()));
}
"@".equals(cell.getCellStyle().getDataFormatString())
成立的,到那时应为获取到的时候多了一个.0所以走了第2个表达式。有大神告知下是什么原因啊?需要在excel里面做格式限定吗? 但是我excel不怎么会弄,第一行必须是有一行标题的? 急求,在线等啊!!!!