Browse Source

[Feature][Plugin-Email] Numeric data type support in email attachment #5424 (#5426)

pull/3/MERGE
ruanwenjun 4 years ago committed by GitHub
parent
commit
5556e47a85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java

6
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java

@ -110,7 +110,11 @@ public class ExcelUtils {
for (int j = 0; j < values.length; j++) { for (int j = 0; j < values.length; j++) {
Cell cell1 = row.createCell(j); Cell cell1 = row.createCell(j);
cell1.setCellStyle(cellStyle); cell1.setCellStyle(cellStyle);
cell1.setCellValue(String.valueOf(values[j])); if (values[j] instanceof Number) {
cell1.setCellValue(Double.parseDouble(String.valueOf(values[j])));
} else {
cell1.setCellValue(String.valueOf(values[j]));
}
} }
} }

Loading…
Cancel
Save