I'm using PHPExcel and need to put a 50 digits number ($cellData
) in a cell. I'm using PHPExcel and prefer to solve my problem with that, but I have no resistance to work with another library.
I first did this:
$objPHPExcel->getActiveSheet()
->SetCellValue('A1', $cellDate);
But it changes the number representation to scientific notation. So I Change it to this:
$objPHPExcel->getActiveSheet()
->getStyle('A1')
->getNumberFormat()
->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT);
$objPHPExcel->getActiveSheet()
->SetCellValue('A1', $cellDate);
It had no effect. finally I did this:
$objPHPExcel->getActiveSheet()
->getCell('A1')
->setValueExplicit($cellDate, PHPExcel_Cell_DataType::TYPE_STRING);
It solves my problem, but adds a single quote before my number which is undesirable. How can I have my whole number, with no change in representation and no additional character?