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

WBOY
Release: 2016-06-13 13:20:10
Original
1177 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!