diff --git a/src/main/java/com/rebuild/core/service/datareport/EasyExcelGenerator.java b/src/main/java/com/rebuild/core/service/datareport/EasyExcelGenerator.java index bc14e56f9..d709da3c0 100644 --- a/src/main/java/com/rebuild/core/service/datareport/EasyExcelGenerator.java +++ b/src/main/java/com/rebuild/core/service/datareport/EasyExcelGenerator.java @@ -381,8 +381,8 @@ protected Map buildData(Record record, Map varsM // Keep Type } else if (dt == DisplayType.DECIMAL) { String format = easyField.getExtraAttr(EasyFieldConfigProps.DECIMAL_FORMAT); - int scale = format.split("\\.").length == 1 ? 0 - : StringUtils.isBlank(format) ? 2 : format.split("\\.")[1].length(); + int scale = StringUtils.isBlank(format) ? 2 : + format.split("\\.").length == 1 ? 0 : format.split("\\.")[1].length(); // Keep Type fieldValue = ((BigDecimal) fieldValue).setScale(scale, RoundingMode.HALF_UP); } else {