Piotr Czajkowski 2 周之前
父節點
當前提交
34fef552c5
共有 1 個文件被更改,包括 5 次插入 和 2 次删除
  1. 5 2
      ExcelORM/ExcelORM/TypeExtensions.cs

+ 5 - 2
ExcelORM/ExcelORM/TypeExtensions.cs

@@ -132,7 +132,10 @@ public static class TypeExtensions
     {
         if (cell == null) return string.Empty;
 
-        var value = cell.GetString();
-        return cell.Style.IncludeQuotePrefix ? $"'{value}" : value;
+        var text = cell.GetString();
+        if (!cell.Value.IsText) return text;
+        if (text.Length == 0) return string.Empty;
+        
+        return cell.Style.IncludeQuotePrefix ? $"'{text}" : text;
     }
 }