0
点赞
收藏
分享

微信扫一扫

java poi 导出excel 数字有问题


 在用poi导出excel时 导出的数字为文本格式(左上角有绿色三角)

 

原因:

cell.setCellType(Cell.CELL_TYPE_NUMERIC);
 cell.setCellValue( numberFormater.format(bValue .doubleValue()) ); 
change to
cell.setsetCellValue( bValue .doubleValue());
 
cellStyle.setDataFormart(HSSFDataFormat.getBuiltinFormat("##.##"));
cell.setCellStyle(cellStyle);

举报

相关推荐

0 条评论