Prevent Excel from reformatting text in the scient

2020-04-20 19:00发布

I have a PHP script which exports data from database to different formats, including as an Excel document. If a text field contains such a value as 123123123123, Excel, by default converts it to 1.23123E+11. Is it possible to prevent this absolutely unnecessary behaviour?

1条回答
老娘就宠你
2楼-- · 2020-04-20 19:17

If your goal is to store the number as text (and not do math on it later) and the PHP is exporting as a CSV, a simple solution would be to export the number as a CONCATENATE function.

=CONCATENATE(123123123123) renders as 123123123123 in text format when the CSV is opened in Excel (this is for Excel 2010).

查看更多
登录 后发表回答