Closed EvilJordan closed 5 years ago
I've identified the partial source of the problem as how vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php
handles interpreting the format and erroneously considering the ACCOUNTING format as a date.
Commenting out the conditional at line 667: if (preg_match('/(\[\$[A-Z]*-[0-9A-F]*\])*[hmsdy](?=(?:[^"]|"[^"]*")*$)/miu', $format, $matches)) {
and letting the code continue without evaluating and changing the Accounting format to a date/time results in the following output:
Getting closer...
I believe that accounting formats should now be handled correctly with the recent changes since 1.8.2 was released
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue for you, please try to help by debugging it further and sharing your results. Thank you for your contributions.
This is:
What is the expected behavior?
setAutoSize
sets column widths in a consistent manner, based on cell contents, not affected by metaNumberFormat
dataWhat is the current behavior?
setAutoSize
returns the incorrect cell width when aNumberFormat
is used, and is not consistent in its incorrect-ness when a color is applied to the sameNumberFormat
. See code and screenshot.What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
Which versions of PhpSpreadsheet and PHP are affected?
1.8.2 - worked fine in 1.4.0