在使用NPOI导出EXCEL时,设置了单元格格式为货币格式,但是导出来的数据格式还是为通用格式,
求解!!!
格式代码:
ICell cell = contentRow.CreateCell(2);
//cell.SetCellValue((double)result.PeriodPayoffInterest.Value);
cell.SetCellValue(20000);
//set date format 设置单元格格式
ICellStyle cellStyle = workBook.CreateCellStyle();
IDataFormat format = workBook.CreateDataFormat();
cellStyle.DataFormat = HSSFDataFormat.GetBuiltinFormat("¥#,##0");
cell.CellStyle = cellStyle;