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

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

WBOY
Release: 2016-06-13 10:38:25
Original
1228 people have browsed it

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);
Copy after login
?

?

Related labels:
gt
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template