From a28d92d2568eac1cbc6007e60b9fa7f0b2673919 Mon Sep 17 00:00:00 2001 From: sebastianlasaj Date: Tue, 10 Apr 2018 11:05:47 +0200 Subject: [PATCH] Update Paper.php This change eliminates problems on host configured with comma as a decimal separator. --- src/PhpWord/Style/Paper.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PhpWord/Style/Paper.php b/src/PhpWord/Style/Paper.php index 3c93ed8f2f..13aefe1c11 100644 --- a/src/PhpWord/Style/Paper.php +++ b/src/PhpWord/Style/Paper.php @@ -162,11 +162,11 @@ public function setSize($size) list($width, $height, $unit) = $this->sizes[$this->size]; if ($unit == 'mm') { - $this->width = Converter::cmToTwip($width / 10); - $this->height = Converter::cmToTwip($height / 10); + $this->width = number_format(Converter::cmToTwip($width / 10),9,'.',''); + $this->height = number_format(Converter::cmToTwip($height / 10),9,'.',''); } else { - $this->width = Converter::inchToTwip($width); - $this->height = Converter::inchToTwip($height); + $this->width = number_format(Converter::inchToTwip($width),9,'.',''); + $this->height = number_format(Converter::inchToTwip($height),9,'.',''); } return $this;