dotnet / Open-XML-SDK

Open XML SDK by Microsoft

Home Page:https://www.nuget.org/packages/DocumentFormat.OpenXml/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug with Open XML SDK

jamesjumper80 opened this issue · comments

I am creating an export and designated a cell as numFmtId = 0 (General format).

  1. When the cell value is an integer under 10 digits (e.g., 123456789) the resulting xlsx output is an integer.
  2. When the cell value is an integer between 10 (e.g., 1234567890) and the number of digits to fill the cell width (let's say 19 digits wide), the output is text, despite being the same numFmtId.
  3. When the cell value is an integer larger than than the cell width (e.g., 20 digits), the result will be a number in scientific notation.

I would expect all three of these scenarios to cells with integers in them.

Desktop (please complete the following information):

  • OS: [e.g. Windows]: Windows 1809
  • Excel version 2401
  • .NET Target: (e.g. .NET Framework, .NET Core, UWP, Xamarin...): Not sure
  • DocumentFormat.OpenXml Version: (e.g. 2.11.0) I'm really sorry. I'm not sure.

I figured the problem out!