From 5556e47a85b40b28688cd41e27a96f4b1bc4e225 Mon Sep 17 00:00:00 2001 From: ruanwenjun <861923274@qq.com> Date: Tue, 11 May 2021 20:53:27 +0800 Subject: [PATCH] [Feature][Plugin-Email] Numeric data type support in email attachment #5424 (#5426) --- .../dolphinscheduler/plugin/alert/email/ExcelUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java b/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java index ae3bcfcc07..90069c6e07 100644 --- a/dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/ExcelUtils.java +++ b/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++) { Cell cell1 = row.createCell(j); 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])); + } } }