-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in phpspreadsheet 1.28.0 in comparison to 1.24.1: Euro currency format doesn't work right anymore #3577
Comments
Your problem appears to have been caused by PR #3377, which changed the definition for the class constant you are using from a style with decimal positions to a style without decimal positions. If you know you will run only on 1.28 or later, you can use $numberFormat = defined(NumberFormat::class . '::FORMAT_CURRENCY_EUR_INTEGER')
? NumberFormat::FORMAT_CURRENCY_EUR
: NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE;
$this->worksheet->getStyleByColumnAndRow(1, 1)
->getNumberFormat()
->setFormatCode($numberFormat); |
@oleibman That's right. That shouldn't have happened. Nothing we can do about it now. |
Agree that it's unfortunate, and that previous behavior can no longer be restored. Closing ticket. |
We still have the option of clearly marking it as an accidental breaking change in the changelog / release notes, etc. I just ran into the same issue and came here to figure out how I missed a breaking change, but saw the change still marked as a simple deprecation in the changelog. |
I have updated the change log with PR #3787 which I have just merged. |
This is:
What is the expected behavior?
(See the example project below)
The created file should handle numbers formatted as currencies correctly:
What is the current behavior?
It doesn't display them correctly (at least) in Microsoft Excel for Mac 16.16.27:
What are the steps to reproduce?
See: https://github.com/finn-matti/phpspreadsheet-problem for a minimal project.
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
I have only tested it with xlsx.
Which versions of PhpSpreadsheet and PHP are affected?
1.28.0 and 1.24.1. I have not tested any other versions.
The text was updated successfully, but these errors were encountered: