This commit is contained in:
WeiLin 2022-05-26 22:52:50 +08:00
commit 5e245820e8
3 changed files with 7 additions and 7 deletions

1
.gitignore vendored
View File

@ -262,3 +262,4 @@ __pycache__/
/BenchmarkDotNet.Artifacts /BenchmarkDotNet.Artifacts
/tests/MiniExcel.Tests.AspNetMvc/packages /tests/MiniExcel.Tests.AspNetMvc/packages
/TestTemplate

View File

@ -23,13 +23,6 @@
<p> 您的 <a href="https://github.com/shps951023/miniexcel">Star</a><a href="https://miniexcel.github.io">赞助</a> 能帮助 MiniExcel 成长 </p> <p> 您的 <a href="https://github.com/shps951023/miniexcel">Star</a><a href="https://miniexcel.github.io">赞助</a> 能帮助 MiniExcel 成长 </p>
</div> </div>
---
<div align="center">
<p> 您的 <a href="https://github.com/shps951023/miniexcel">Star</a><a href="https://miniexcel.github.io">赞助</a> 能帮助 MiniExcel 成长 </p>
</div>
--- ---
### 1.26.2 ### 1.26.2

View File

@ -267,6 +267,11 @@ namespace MiniExcelLibs.OpenXml
{ {
cellValueStr = ConvertToDateTimeString(propInfo, cellValue); cellValueStr = ConvertToDateTimeString(propInfo, cellValue);
} }
else if (TypeHelper.IsNumericType(type))
{
if (decimal.TryParse(cellValueStr, out var decimalValue))
cellValueStr = decimalValue.ToString(System.Globalization.CultureInfo.InvariantCulture);
}
//TODO: ![image](https://user-images.githubusercontent.com/12729184/114848248-17735880-9e11-11eb-8258-63266bda0a1a.png) //TODO: ![image](https://user-images.githubusercontent.com/12729184/114848248-17735880-9e11-11eb-8258-63266bda0a1a.png)
newRow.InnerXml = newRow.InnerXml.Replace(key, cellValueStr); newRow.InnerXml = newRow.InnerXml.Replace(key, cellValueStr);
@ -614,6 +619,7 @@ namespace MiniExcelLibs.OpenXml
else if (decimal.TryParse(cellValueStr, out var outV)) else if (decimal.TryParse(cellValueStr, out var outV))
{ {
c.SetAttribute("t", "n"); c.SetAttribute("t", "n");
cellValueStr = outV.ToString(System.Globalization.CultureInfo.InvariantCulture);
} }
else if (cellValue is bool) else if (cellValue is bool)
{ {