mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 22:38:42 +00:00
Arithmetic fixes
This commit is contained in:
parent
aef5b006c7
commit
b9c9b9ed1c
|
|
@ -86,23 +86,15 @@ class Money {
|
||||||
|
|
||||||
public function mult($value)
|
public function mult($value)
|
||||||
{
|
{
|
||||||
if(is_string($value) || is_float($value)) {
|
if(is_float($value) || is_int($value)) {
|
||||||
$this->value *= self::toInt((string) $value);
|
|
||||||
} elseif(is_int($value)) {
|
|
||||||
$this->value *= $value;
|
$this->value *= $value;
|
||||||
} elseif($value instanceof Money) {
|
|
||||||
$this->value *= $value->getInt();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function div($value)
|
public function div($value)
|
||||||
{
|
{
|
||||||
if(is_string($value) || is_float($value)) {
|
if(is_float($value) || is_int($value)) {
|
||||||
$this->value = self::toInt((string) ($this->value / self::toInt((string) $value)));
|
|
||||||
} elseif(is_int($value)) {
|
|
||||||
$this->value = self::toInt((string) ($this->value / $value));
|
$this->value = self::toInt((string) ($this->value / $value));
|
||||||
} elseif($value instanceof Money) {
|
|
||||||
$this->value = self::toInt((string) ($this->value / $value->getInt()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user