Skip to content

Commit

Permalink
Merge ce500d4 into b30b744
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed May 30, 2021
2 parents b30b744 + ce500d4 commit e496c10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -16,7 +16,7 @@
},
"require": {
"php": "^7.2 || ^8.0",
"moneyphp/money": "^3.3"
"moneyphp/money": "^3.3 || ^4.0"
},
"require-dev": {
"phpunit/phpunit": "^8.4 || ^9.0"
Expand Down
6 changes: 3 additions & 3 deletions src/Taxable.php
Expand Up @@ -30,7 +30,7 @@ abstract class Taxable implements Contracts\Taxable
*/
public function getAmountWithoutTax(Money $money): string
{
return $money->divide(1 + $this->taxRate())->getAmount();
return $money->divide((string) (1 + $this->taxRate()))->getAmount();
}

/**
Expand All @@ -42,7 +42,7 @@ public function getAmountWithoutTax(Money $money): string
*/
public function getAmountWithTax(Money $money): string
{
return $money->multiply(1 + $this->taxRate())->getAmount();
return $money->multiply((string) (1 + $this->taxRate()))->getAmount();
}

/**
Expand All @@ -54,7 +54,7 @@ public function getAmountWithTax(Money $money): string
*/
public function getTaxAmount(Money $money): string
{
return $money->multiply($this->taxRate())->getAmount();
return $money->multiply((string) $this->taxRate())->getAmount();
}

/**
Expand Down

0 comments on commit e496c10

Please sign in to comment.