From 61408fc69100fae902332f09047f12acaa95c880 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Wed, 4 Jan 2017 09:27:42 +0100 Subject: [PATCH] Properly format non-integer font sizes (#66) The OOXML spec defines the font sizes (the `sz` element) as a double, so the value needs to be wrapped in `PHPExcel_Shared_String::FormatNumber()` to avoid breaking in non-English locales. --- src/PhpSpreadsheet/Writer/Xlsx/Style.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Style.php b/src/PhpSpreadsheet/Writer/Xlsx/Style.php index 036599e2..d9b507fd 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Style.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Style.php @@ -323,7 +323,7 @@ class Style extends WriterPart // Size if ($pFont->getSize() !== null) { $objWriter->startElement('sz'); - $objWriter->writeAttribute('val', $pFont->getSize()); + $objWriter->writeAttribute('val', \PhpOffice\PhpSpreadsheet\Shared\StringHelper::formatNumber($pFont->getSize())); $objWriter->endElement(); }