Przeglądaj źródła

读取excel指定小数点后几位

[user3] 4 lat temu
rodzic
commit
09dda167e5

+ 1 - 0
src/main/java/com/jeeplus/common/utils/excel/ImportExcel.java

@@ -233,6 +233,7 @@ public class ImportExcel {
 					} else {
 						NumberFormat nf = NumberFormat.getInstance();
 						nf.setGroupingUsed(false);// true时的格式:1,234,567,890
+						nf.setMaximumFractionDigits(4);
 						val = nf.format(cell.getNumericCellValue());// 数值类型的数据为double,所以需要转换一下
 					}
 				} else if (cell.getCellType() == Cell.CELL_TYPE_STRING) {