|
@@ -228,9 +228,8 @@ public class PoiUtils {
|
228
|
228
|
public static String getCellValue(Cell cell) {
|
229
|
229
|
String value = null;
|
230
|
230
|
if (cell == null) return value;
|
231
|
|
- DecimalFormat df = new DecimalFormat("0"); //格式化number String字符
|
|
231
|
+ DecimalFormat df = new DecimalFormat("0.##"); //格式化number String字符
|
232
|
232
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //日期格式化
|
233
|
|
- DecimalFormat df2 = new DecimalFormat("0"); //格式化数字
|
234
|
233
|
switch (cell.getCellTypeEnum()) {
|
235
|
234
|
case STRING:
|
236
|
235
|
value = cell.getRichStringCellValue().getString();
|
|
@@ -248,7 +247,7 @@ public class PoiUtils {
|
248
|
247
|
} else if ("m/d/yy".equals(cellStyle)) {
|
249
|
248
|
value = sdf.format(cell.getDateCellValue());
|
250
|
249
|
} else {
|
251
|
|
- value = df2.format(cell.getNumericCellValue());
|
|
250
|
+ value = df.format(cell.getNumericCellValue());
|
252
|
251
|
}
|
253
|
252
|
break;
|
254
|
253
|
case BOOLEAN:
|