解决使用PhpSpreadsheet写入长数字到Excel中时显示为科学计数法


$spreadsheet->getActiveSheet()->getStyle('A1')->getNumberFormat() ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER);//设置NumberFormat为FORMAT_NUMBER,有其他格式需要可以改成其他格式,如日期:FORMAT_DATE_YYYYMMDD

 

 

更多的格式设置可以查阅官方文档

https://phpoffice.github.io/PhpSpreadsheet/master/PhpOffice.html

https://phpspreadsheet.readthedocs.io/en/develop/

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM