Skip to content

Commit

Permalink
If cellValue is string no matter that it contains only numbers will p…
Browse files Browse the repository at this point in the history
…ut the value as text. Preventing of losing leading zeroes
  • Loading branch information
Milen committed Nov 20, 2024
1 parent 8e41121 commit a7eea9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MiniExcel/SaveByTemplate/ExcelOpenXmlTemplate.Impl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ private void UpdateDimensionAndGetRowsInfo(IDictionary<string, object> inputMaps
else
{
var cellValueStr = cellValue?.ToString(); /* value did encodexml, so don't duplicate encode value https://gitee.com/dotnetchina/MiniExcel/issues/I4DQUN*/
if (isMultiMatch) // if matchs count over 1 need to set type=str ![image](https://user-images.githubusercontent.com/12729184/114530109-39d46d00-9c7d-11eb-8f6b-52ad8600aca3.png)
if (isMultiMatch || cellValue is string) // if matchs count over 1 need to set type=str ![image](https://user-images.githubusercontent.com/12729184/114530109-39d46d00-9c7d-11eb-8f6b-52ad8600aca3.png)
{
c.SetAttribute("t", "str");
}
Expand Down

0 comments on commit a7eea9e

Please sign in to comment.