From a79b2192e63a2a23c1d287309d9263be3f34d0f7 Mon Sep 17 00:00:00 2001 From: willkensonh Date: Fri, 12 Oct 2018 16:49:44 +1100 Subject: [PATCH] add support for number formats --- src/Spout/Common/Entity/Style/NumberFormat.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Spout/Common/Entity/Style/NumberFormat.php b/src/Spout/Common/Entity/Style/NumberFormat.php index e26af8e..fe82032 100644 --- a/src/Spout/Common/Entity/Style/NumberFormat.php +++ b/src/Spout/Common/Entity/Style/NumberFormat.php @@ -29,6 +29,13 @@ class NumberFormat private $commas; + public function __construct(int $type = null) + { + if (!empty($type)) { + $this->setType($type); + } + } + /** * @param int $id * @return NumberFormat @@ -55,7 +62,7 @@ class NumberFormat { if (!in_array($type,self::TYPES)) { return $this; - //todo throw some excpection or something + //todo throw some exception or something? } $this->type = $type; if ($type == self::TYPE_CURRENCY) {