Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPExcel Thousand Seperator for Switzerland eg 1'234'456

I want to format the numbers like 1'234'567 so my thousand separator will be the ' symbol.

In Excel (OpenOffice) I can choose the language (German (Switzerland)) and then the format code will be "#'##0" which works like a charm.

But if I use the same code with PHPEexcel I get the following result

'6
'159
15'196
24'120
1569'590
55550'223

but it should produce

6
159
15'196
24'120
1'569'590
55'550'223

Has anybody a solution for that?

Thanks

like image 711
Dominik Kukacka Avatar asked Jul 02 '13 07:07

Dominik Kukacka


1 Answers

Set the mask you use in PHPExcel as

"#,##0"

When a file you've created in PHPExcel is opened in MS Excel/Open Office, it should adjust to the locale settings for that version of MS Excel

PHPExcel itself uses the , thousands separator as it is not locale-aware; but when the files it creates are opened in a local-aware spreadsheet program such as MS Excel, Gnumeric or Open/Libre Office, it should then appear according to that applications locale settings

like image 140
Mark Baker Avatar answered Oct 15 '22 21:10

Mark Baker