add support for number formats

This commit is contained in:
willkensonh 2018-10-12 16:49:44 +11:00
parent a8b3568719
commit a79b2192e6

View File

@ -29,6 +29,13 @@ class NumberFormat
private $commas; private $commas;
public function __construct(int $type = null)
{
if (!empty($type)) {
$this->setType($type);
}
}
/** /**
* @param int $id * @param int $id
* @return NumberFormat * @return NumberFormat
@ -55,7 +62,7 @@ class NumberFormat
{ {
if (!in_array($type,self::TYPES)) { if (!in_array($type,self::TYPES)) {
return $this; return $this;
//todo throw some excpection or something //todo throw some exception or something?
} }
$this->type = $type; $this->type = $type;
if ($type == self::TYPE_CURRENCY) { if ($type == self::TYPE_CURRENCY) {