PHPExcel用逗号编写后转换点 [英] PHPExcel converts dot after writing in comma

查看:221
本文介绍了PHPExcel用逗号编写后转换点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过导入csv文件生成一个Excel文件.在CSV中具有以下编号的内容
4.0238484
5.3833888
点分隔
但是,如果我编写的是Excel文件,则该列向我显示以下格式的数字
4,0238484
5,3833888
我要点而不是逗号.
我该怎么做?
PHPExcel版本1.7.7

I generate an Excel file with importing a csv file. In CSV has contents with following numbers
4.0238484
5.3833888
dot seperated
But if I write an Excel file than the column show me the numbers in following format
4,0238484
5,3833888
I want the dot instead of comma.
How can I make it?
PHPExcel Version 1.7.7

推荐答案

在PhpSpreadsheet(下一代PhpExcel)中,您可以通过以下方式避免出现这种情况:

In PhpSpreadsheet (next generation of PhpExcel) you can avoid it's by this:

$sheet->setCellValueExplicitByColumnAndRow(__COL_INDEX__, __ROW_INDEX__, __SOME_DATA__, DataType::TYPE_STRING);

setCellValueExplicitByColumnAndRow可以强制将您的数据转换为字符串

setCellValueExplicitByColumnAndRow can force turn your data into string

这篇关于PHPExcel用逗号编写后转换点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆