I have a problem when reading value from Excel sheet.
This is my code:
$phpExcelObjReader = PHPExcel_IOFactory::createReaderForFile($posFile);
$phpExcelObj = $phpExcelObjReader->load($posFile);
foreach ($phpExcelObj->getSheetNames() as $sheetIndex => $sheetName) {
foreach($phpExcelObj->getSheet($sheetIndex)->getRowIterator() as $row){
$cellIterator = $row->getCellIterator();
$cellIterator->setIterateOnlyExistingCells(false);
$cells = array();
foreach($cellIterator as $cell){
$cells[] = $cell->getCalculatedValue();
}
$fileData[] = $cells;
//log_message('ERROR', print_r($cells, TRUE));
}
}
When I read n excel cell having value 358100000, it is getting stored to DB as 3.581E+8
Please help me to solve this issue.
This post really helped me
just add
ini_set("precision", "15");
set the precision to the number count you need to get, for me its 15 instead of 14 on my php.ini