Skip to content
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

Number formatting results in CR LF characters at end #1924

Closed
serverdevil opened this issue Mar 15, 2021 · 2 comments
Closed

Number formatting results in CR LF characters at end #1924

serverdevil opened this issue Mar 15, 2021 · 2 comments

Comments

@serverdevil
Copy link

serverdevil commented Mar 15, 2021

This is:

- [X] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

I narrowed down an issue with an excel file to this. The value 826 formatted with #,##0.00 _€ is resulting in a bad formatted value.

What is the expected behavior?

826.00<space><space>

What is the current behavior?

826.00<space><space><CR><LF>
As is content (verified that the last 2 chars are actually CR and LF)
826.00 ��

What are the steps to reproduce?

<?php

require __DIR__ . '/vendor/autoload.php';

echo PhpOffice\PhpSpreadsheet\Style\NumberFormat::toFormattedString(826, "#,##0.00 _€");

?>

Which versions of PhpSpreadsheet and PHP are affected?

1.17.1

@serverdevil
Copy link
Author

Closed by mistake.

@MarkBaker
Copy link
Member

Expected output from a mask of #,##0.00 _€ should have been 826.00<space><space>€

Fix implemented and merged to the master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants