example to set datatype?

Topics: Developer Forum, User Forum
Aug 21, 2007 at 5:43 PM
Edited Aug 21, 2007 at 6:39 PM
is there an example on how to set the datatype
is there a constant for the 'date' datatype?

i use:
$objPHPExcel->getActiveSheet()->getCell($cellAddr)->setDataType(PHPExcelCellDataType::TYPE_STRING);

for a field that contains 16 digits i.e. 1234567890123456

but i get 1.2345E+15 in the cell & lose the last digit i.e. 1234567890123450
Coordinator
Aug 21, 2007 at 7:41 PM
Edited Aug 21, 2007 at 7:55 PM
We have not yet implemented a "date" datatype...
Check the API documentation, there is an option to disable automatic datatype recognition (setValue($pValue = null, $pUpdateDataType = true))

I'll create a work item for the date datatype, would be a good feature in one of the next versions...
Coordinator
Aug 21, 2007 at 7:43 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Aug 21, 2007 at 7:44 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.