Skip to content

Commit

Permalink
Avoid floating point conversion errors
Browse files Browse the repository at this point in the history
  • Loading branch information
z38 committed Apr 27, 2018
1 parent 33389d7 commit 862fafa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Z38/SwissPayment/Money/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class Money
*/
public function __construct($cents)
{
$this->cents = intval($cents);
$this->cents = is_int($cents) ? $cents : intval(round($cents));
}

/**
Expand Down

0 comments on commit 862fafa

Please sign in to comment.