Skip to content

Commit

Permalink
REF Ensure that getAmount includes 0s in decimal places up to 2 places
Browse files Browse the repository at this point in the history
  • Loading branch information
seamuslee001 authored and eileenmcnaughton committed Apr 19, 2021
1 parent 2ae7864 commit 6c990cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CRM/Core/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,9 @@ protected function getCurrency($params = []) {
protected function getAmount($params = []) {
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 filter_var($params['amount'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
return CRM_Utils_Money::formatLocaleNumericRoundedByPrecision(filter_var($params['amount'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION), 2);
}
return $params['amount'];
return CRM_Utils_Money::formatLocaleNumericRoundedByPrecision($params['amount'], 2);
}

/**
Expand Down

0 comments on commit 6c990cc

Please sign in to comment.