From b9c9b9ed1c3dc2a4945d0f5de1727da39ac3e3a8 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 3 Mar 2016 15:57:24 +0100 Subject: [PATCH] Arithmetic fixes --- Localization/Money.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Localization/Money.php b/Localization/Money.php index 1d7a1e924..56413d00b 100644 --- a/Localization/Money.php +++ b/Localization/Money.php @@ -86,23 +86,15 @@ class Money { public function mult($value) { - if(is_string($value) || is_float($value)) { - $this->value *= self::toInt((string) $value); - } elseif(is_int($value)) { + if(is_float($value) || is_int($value)) { $this->value *= $value; - } elseif($value instanceof Money) { - $this->value *= $value->getInt(); } } public function div($value) { - if(is_string($value) || is_float($value)) { - $this->value = self::toInt((string) ($this->value / self::toInt((string) $value))); - } elseif(is_int($value)) { + if(is_float($value) || is_int($value)) { $this->value = self::toInt((string) ($this->value / $value)); - } elseif($value instanceof Money) { - $this->value = self::toInt((string) ($this->value / $value->getInt())); } } }