PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.2k forks source link

float percent -> ?0.2f% #1317

Open Xenofexs opened 6 years ago

Xenofexs commented 6 years ago

Hi. I use this code for transform xls to csv.

require_once 'Classes/PHPExcel/IOFactory.php';

$inputFileType = 'Excel5'; $inputFileName = 'YOUR_EXCEL_FILE_PATH';

$objReader = PHPExcel_IOFactory::createReader($inputFileType); $objPHPExcelReader = $objReader->load($inputFileName);

$loadedSheetNames = $objPHPExcelReader->getSheetNames();

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcelReader, 'CSV');

foreach($loadedSheetNames as $sheetIndex => $loadedSheetName) { $objWriter->setSheetIndex($sheetIndex); $objWriter->save($loadedSheetName.'.csv'); }

But the percent is not converted. Ex : In the xls, C1 = 0,0226115615112098% After the convertion, in the CSV, C1 = ?0.2f%

I don't find how specify the good format in this case.

xls to csv

Thank you in advence :)