mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-23 23:08:39 +00:00
Arithmetic fixes
This commit is contained in:
parent
aef5b006c7
commit
b9c9b9ed1c
|
|
@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user