-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
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)
What is the expected behavior?
A reader should read the data as it is. All data should be converted correctly without loss of precision.
What is the current behavior?
Numbers are converted losing precision. The number '753,149999999999' for example gets changed to '753.15'.
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...
$spreadsheet = reader->load('yourexcel.xlsx');
$spreadsheet = $this->spreadSheetPreparationForWrite($spreadsheet, 1);
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Csv($spreadsheet);
$writer->setSheetIndex(1);
$writer->save('savedas.csv');
### Which versions of PhpSpreadsheet and PHP are affected?
Metadata
Metadata
Assignees
Labels
No labels