PHPExcel 1.7.6 rounds up cell value

Topics: Developer Forum
Jul 17, 2012 at 1:09 PM
Edited Jul 17, 2012 at 1:10 PM

I'm trying to import a XLS, and one of the columns is a Social Security Number. When i try to get that cell's value using getValue(), it rounds the value up. For example 2840201181096 is rounded up to 2840201181100.

I'm using PHPExcel 1.7.6 & the file type is Excel2007.

How to I get the EXACT value that is entered in that cell?? no rounding up, no formating.

Coordinator
Jul 17, 2012 at 4:50 PM

PHPExcel should not round string values, though there may be rounding of numeric values by PHP depending on how you are displaying them (especially as this is larger than the maximum integer for a 32-bit system. However, it should be defined as a string in your xls file.

Check that the data value being returned by getValue is a string (using var_dump or similar)

Jul 23, 2012 at 9:46 AM

Thank you, it worked.

The cell was formated as a number in excel