Skip to content

Commit

Permalink
Merge pull request #20279 from seamuslee001/5.37
Browse files Browse the repository at this point in the history
Fix money formatting opps
  • Loading branch information
seamuslee001 authored May 13, 2021
2 parents cd63fcc + 759db98 commit 4e88bf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CRM/Core/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1166,9 +1166,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 CRM_Utils_Money::formatLocaleNumericRoundedByPrecision(filter_var($params['amount'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION), 2);
return CRM_Utils_Money::formatUSLocaleNumericRounded(filter_var($params['amount'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION), 2);
}
return CRM_Utils_Money::formatLocaleNumericRoundedByPrecision($params['amount'], 2);
return CRM_Utils_Money::formatUSLocaleNumericRounded($params['amount'], 2);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion CRM/Utils/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ protected static function formatLocaleNumeric($amount) {
*
* @return string
*/
protected static function formatUSLocaleNumericRounded($amount, int $numberOfPlaces): string {
public static function formatUSLocaleNumericRounded($amount, int $numberOfPlaces): string {
if (!extension_loaded('intl') || !is_numeric($amount)) {
// @todo - we should not attempt to format non-numeric strings. For now
// these will not fail but will give notices on php 7.4
Expand Down

0 comments on commit 4e88bf2

Please sign in to comment.