Home >Backend Development >PHP Tutorial > PHP导出excel时科学计数法的处置

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

WBOY
WBOYOriginal
2016-06-13 13:20:101230browse

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);
?

?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article: php防止刷新交付 Next article: php 下传限制