当前位置:Gxlcms > PHP教程 > PHP导出excel时科学计数法的处置

PHP导出excel时科学计数法的处置

时间:2021-07-01 10:21:17 帮助过:37人阅读

PHP导出excel时科学计数法的处理
$activeSheet->getStyle($this->numToEn($col).($row+2))->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT);
					$activeSheet->setCellValue($this->numToEn($col).($row+2)," ".$elements[$row][$col]);  //在写入Excels单元格的内容之前加一个空格,防止长数字被转化成科学计数法
					$activeSheet->getStyle($this->numToEn($col).($row+2))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
?

?

人气教程排行