You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [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)
What is the expected behavior?
A Scientific Number Format Mask such as '0.000E+00' will render the required number of decimal places. (in this case, 3dp)
What is the current behavior?
The Scientific Number Format Mask only renders 2 decimal places
<?phprequire__DIR__ . '/vendor/autoload.php';
// Create new Spreadsheet object$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();
$worksheet->getCell('A1')->setValue(-12345.67890);
$worksheet->getCell('A1')
->getStyle()->getNumberFormat()
->setFormatCode('0.000E+00');
// Expected result: -1.235E+4// Actual result: -1.24E+4var_dump($worksheet->getCell('A1')->getFormattedValue());
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?
Yes
Which versions of PhpSpreadsheet and PHP are affected?
All
The text was updated successfully, but these errors were encountered:
This is:
What is the expected behavior?
A Scientific Number Format Mask such as '0.000E+00' will render the required number of decimal places. (in this case, 3dp)
What is the current behavior?
The Scientific Number Format Mask only renders 2 decimal places
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:
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
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Yes
Which versions of PhpSpreadsheet and PHP are affected?
All
The text was updated successfully, but these errors were encountered: