This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 5556e47  [Feature][Plugin-Email] Numeric data type support in email 
attachment #5424 (#5426)
5556e47 is described below

commit 5556e47a85b40b28688cd41e27a96f4b1bc4e225
Author: ruanwenjun <[email protected]>
AuthorDate: Tue May 11 20:53:27 2021 +0800

    [Feature][Plugin-Email] Numeric data type support in email attachment #5424 
(#5426)
---
 .../org/apache/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 ae3bcfc..90069c6 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]));
+                    }
                 }
             }
 

Reply via email to