diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 86ea55a019fc..3d694b7d5460 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -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); } /**