-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
This is:
- 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)
What is the expected behavior?
Apply a valid currency format.
What is the current behavior?
Excel does not accept the format code, displays issue on open.
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:
<?php
require __DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
// add code that show the issue here...
$sheet = $spreadsheet->getActiveSheet();
$sheet->getCell([1, 1])->setValue(1234)->getStyle()->applyFromArray(
[
'numberFormat' => [
'formatCode' => (new \PhpOffice\PhpSpreadsheet\Style\NumberFormat\Wizard\Accounting('EUR'))->format(),
],
]
);If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
- Reader
- Writer
- Styles
- Data Validations
- Formula Calculations
- Charts
- AutoFilter
- Form Elements
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
.xlsx, most likely others too.
Which versions of PhpSpreadsheet and PHP are affected?
PHP: 8.2
PhpSpreadsheet: at least up from 2.1.0
Excel: 2021/365
output.xlsx
Metadata
Metadata
Assignees
Labels
No labels