setcellvalue phpexcel 时美元符号显示在任何整数值之前而不是实际值?

dollar sign is shown in before any integer value rather than actual value when setcellvalue phpexcel?

我正在使用下面的代码设置单元格值,但它在单元格中显示的输出与原来的不同:

$excel2->getActiveSheet()->setCellValue("F2",'1234567890');

Output
,234,567,890.00 

我期望的实际输出是1234567890,但我不知道为什么会这样显示,任何帮助将不胜感激。

使用数字格式并根据您的要求设置格式代码。 试试下面的代码。

$excel2->getActiveSheet()->setCellValue("F2",'1234567890')->getNumberFormat()->SetFormatCode('#,##0');

您应该在单元格中添加数字格式

$excel2->getActiveSheet()->getStyle('F2') ->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberForm‌​at::FORMAT_NUMBER);

有关单元格样式的更多信息,请查看 here 并查看左侧导航链接中的 样式 类