phpExcel write long number in cell

后端 未结 3 2013
渐次进展
渐次进展 2020-12-14 13:31

While writing the excel file is fine I see that really long numbers are formulas in excel

Example: 8.71129E+12

instead of: 1234567890

How can I chang

相关标签:
3条回答
  • 2020-12-14 13:45
    $objPHPExcel->getActiveSheet()->setCellValueExplicit('A1', '1234567890', PHPExcel_Cell_DataType::TYPE_STRING);
    
    0 讨论(0)
  • 2020-12-14 13:55

    Try this code it's works for me :

    $objPHPExcel
       ->getActiveSheet()
       ->getCellByColumnAndRow($col, $row)
       ->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING);
    

    And Good luck !

    0 讨论(0)
  • 2020-12-14 13:58

    Either set the value explicitly as a string, or set a number format mask for the cell that forces display of all digits (e.g. '#,##0' 0r '0') rather than default format.

    0 讨论(0)
提交回复
热议问题