Reading XLS with diferent number formats problem

Topics: Developer Forum, Project Management Forum, User Forum
Jan 8, 2014 at 2:23 PM
Hello,

I am trying to read one xls file with the help of this code:
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
The problem i have is that that xls has some columns with a number format that does not display decimals and it rounds the numbers up. So instead of reading 3,6 it reads 4 and so on.
My question is, is there a way of reading the sheet, with numbers that have decimals, using the same simple 2 lines of code reading metod "toArray()" ?
Jan 8, 2014 at 4:30 PM
Put the third parameter (formatData) to false.
Jan 8, 2014 at 4:46 PM
Worked like a charm.
Thanks for the quick response.