Skip to content

Number formatting results in CR LF characters at end #1924

@serverdevil

Description

@serverdevil

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions