Merge pull request #321 from 1day2die/hotfix_decimals_paypal

HOTFIX: Error when calculating price+tax has 3 decimals
This commit is contained in:
AVMG 2021-12-02 18:18:06 +01:00 committed by GitHub
commit 9f85b05a5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,7 +43,7 @@ class PaypalProduct extends Model
/**
* @param mixed $value
* @param string $locale
*
*
* @return float
*/
public function formatToCurrency($value,$locale = 'en_US')
@ -70,7 +70,7 @@ class PaypalProduct extends Model
*/
public function getTaxValue()
{
return $this->price*$this->getTaxPercent()/100;
return number_format($this->price*$this->getTaxPercent()/100,2);
}
/**
@ -78,8 +78,8 @@ class PaypalProduct extends Model
*
* @return float
*/
public function getTotalPrice()
public function getTotalPrice()
{
return $this->price+($this->getTaxValue());
return number_format($this->price+$this->getTaxValue(),2);
}
}