getValue() cell format issue

Topics: Developer Forum, Project Management Forum, User Forum
Jan 27, 2012 at 12:34 PM


Data in the Excel2007 is 


but when I try to access the value i get this 3.576460002011E+14

What can i do for this?



$objPHPExcel->getActiveSheet()->getCell('A1')->getValue(); //returns 3.576460002011E+14


Jan 31, 2012 at 9:43 AM
Edited Jan 31, 2012 at 9:44 AM


Try this


Feb 1, 2012 at 1:56 PM

Thanks for your answer but this is for writing to excel, I have problem with reading from excel. Any advice?

Feb 1, 2012 at 8:51 PM

try using getFormattedValue() instead of getValue(). PHP has this tendency to use scientific notation for numbers above a certain size. getFormattedValue() will return the value as a string, formatted according to the cell format rules defined in Excel.

Alternatively, use PHP functions such as sprintf() to format the value as you need.

Feb 2, 2012 at 7:07 AM

Thank you very much  getFormattedValue() works for me:)