Skip to content

Commit

Permalink
Merge pull request #20098 from eileenmcnaughton/536
Browse files Browse the repository at this point in the history
Port #20040
  • Loading branch information
eileenmcnaughton authored Apr 19, 2021
2 parents faa0e6a + 6c990cc commit ddb6be2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CRM/Core/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,11 @@ protected function getCurrency($params = []) {
* @throws \CRM_Core_Exception
*/
protected function getAmount($params = []) {
return CRM_Utils_Money::format($params['amount'], NULL, NULL, TRUE);
if (!CRM_Utils_Rule::numeric($params['amount'])) {
CRM_Core_Error::deprecatedWarning('Passing Amount value that is not numeric is deprecated please report this in gitlab');
return CRM_Utils_Money::formatLocaleNumericRoundedByPrecision(filter_var($params['amount'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION), 2);
}
return CRM_Utils_Money::formatLocaleNumericRoundedByPrecision($params['amount'], 2);
}

/**
Expand Down

0 comments on commit ddb6be2

Please sign in to comment.