CoreOffice / CoreXLSX

Excel spreadsheet (XLSX) format parser written in pure Swift
Apache License 2.0
831 stars 87 forks source link

Excel Parser Truncates Leading 0's and Maybe Trailing 0's #167

Open Senbazuru1075 opened 1 year ago

Senbazuru1075 commented 1 year ago

Version

Current

Description of the bug

The leading and trailing zeros of formatted numbers maybe truncated. Usually numbers don't start with zero so it's probably just the leading 0's

Steps to reproduce

Steps to reproduce the behavior, for example:

  1. Create an Excel File with leading zeros
  2. Parse worksheet and strings
  3. Append to an object or print into the console
  4. 00017 is actually 17

Expected behavior

Leading zeros should display

Additional context

I'm interested in implementing a workaround to get the truncated 0's This attached screenshot shows a possible solution. If you search truncated 0's with xlsx parser you get the solution that I found. Maybe you guys have a workaround for this Swift package?

Screen Shot 2023-01-03 at 4 35 27 PM
Joannis commented 1 year ago

Hey @Senbazuru1075 can you provide a sample code + XLSX?

Senbazuru1075 commented 1 year ago

Sorry, I can't provide the code because it was for work. I'm using the package personally. I will update if I face the same issues.