Numbers format

Topics: Developer Forum, User Forum
Oct 8, 2007 at 11:54 PM


I use PHPExcelWriterExcel5 writer. (stable version 1.4.5)

I would like to display numbers as I introduce them:
38468495700051 and not 3,84685E+13
04700 and not 4700
0623443212 and not 623443212

I have tried all the PHPExcelCellDataType values, combined with PHPExcelStyleNumberFormat values, but I don't manage to display values as I wish.

What should I do to not have them modified ?

Thanks !!!
Oct 9, 2007 at 11:58 AM
This should work fine on Excel2007?

Excel5 does not support all formats Excel2007 writer does...
Oct 10, 2007 at 8:16 AM
Format the cells as strings. I used to do this when I was using the software on which PHPExcelWriterExcel5 writer is based (Spreadsheet Excel Writer) and it worked fine (e.g. it preserved the initial 0 in a number). I have never tested the embedded version of this software in PHPExcel, but I guess it should work...
Oct 10, 2007 at 9:43 AM
Be sure to set the cell's data type explicitly if you use this workaround. PHPExcel will determine the value is a number if you don't...
Feb 23, 2009 at 4:14 PM
i want the same thing i.e. want to apply "Text" format rather than "General" format
not for any single cell but for whole sheet
if i apply it cell by cell the page dies out of timeout
any thing possible here?

Feb 24, 2009 at 7:24 AM
@samsami2u: This is unfortunately not possible at the moment. Applying a style to the entire sheet would involve setting a column style for a the full range of columns. But column styles are not supported at the moment.