phpExcel setFormatCode works incorrect

Topics: Developer Forum, User Forum
Sep 27, 2013 at 1:59 PM
Hello, i want to format cells as number
format string is: "# ###,00"

I need that number 2140560,34 will be formatted in excel as "2 140 560,34"
thousands separator is "space", decimal separator is coma.

But when i'm trying
$objPHPExcel->getActiveSheet()->getStyle("A1")->getNumberFormat()->setFormatCode("# ###,00");
In excel i've got result "# ## #00"
It's strange phpexcel bug or i should write cell format in other way?

Sep 27, 2013 at 2:48 PM
Try with : "#,###.00"

Whatever the language, Excel notes formats in English in the file and transforms them to present to the user. PHPExcel directly writes the file and considers to be given an English format, if you give him a format in another language, when the localized Excel opens the file, it transforms the format and you are strange things.

P.S.: It seems to me reading intervention by Mark concerning the possibility of define localized formats, but I no longer remember details and the version concerned.