【发布时间】:2019-03-26 10:44:10
【问题描述】:
谁能解释一下如何在 PHPExcel 中设置货币?我有一个单元格值,其格式类似于字符串“1 234 567 €”。所以我这样设置formatCode:
$sheet->setCellValue($col . $row, $value);
$sheet->getStyle($col . $row)->getNumberFormat()->setFormatCode( '# ### €');
结果的格式很好,但是当我对它进行排序时(OpenOffice、LibreOffice),它的排序就像一个字符串而不是一个数字。这意味着 2 > 10。我错过了什么吗?
【问题讨论】:
标签: sorting format phpexcel currency