PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.2k forks source link

getValue() returns an empty string instead of 0 (zero) when the cell contains numeric 0. #1276

Closed the-red-one closed 6 years ago

the-red-one commented 6 years ago

When reading a cell value from an Excel file, which explicitly set to numerical zero, getValue() returns an empty string, which is rather disappointing, as there's no way to determine if the cell is just left empty (on purpose) or its value for some reason is set to zero (e.g. an equivalent for a boolean 'false').

Ideally I'd have getValue to return 0 if the cell value is 0, and null / empty string if the cell is empty.

Apologies if this has been raised already (I could only find similar, but not entirely the same, issue with 'fromArray()' function, which does not help in my case).

Thanks.

the-red-one commented 6 years ago

My bad, extensive debugging showed it was my oversight. Everything works perfectly.