Skip to content

Commit

Permalink
round amount
Browse files Browse the repository at this point in the history
  • Loading branch information
mkreusch authored Dec 17, 2020
1 parent c9fb45e commit ef4b6aa
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public function getAmount()
}

/**
* @param string $amount
* @param string|float $amount
*
* @return Price
*/
public function setAmount($amount)
{
$this->amount = $amount;
$this->amount = number_format(round($amount, 2), 2, '.', '');

return $this;
}
Expand Down

0 comments on commit ef4b6aa

Please sign in to comment.