From 209fd988c4186e74464e4b2dbaec96fcda38bb52 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Fri, 21 Aug 2020 16:37:33 +0100 Subject: [PATCH] Fix setAmount should not return localized amount --- Civi/Payment/PropertyBag.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Civi/Payment/PropertyBag.php b/Civi/Payment/PropertyBag.php index 49a4ea4e8c..f8817b8c4e 100644 --- a/Civi/Payment/PropertyBag.php +++ b/Civi/Payment/PropertyBag.php @@ -423,8 +423,7 @@ class PropertyBag implements \ArrayAccess { if (!is_numeric($value)) { throw new \InvalidArgumentException("setAmount requires a numeric amount value"); } - - return $this->set('amount', $label, \CRM_Utils_Money::format($value, NULL, NULL, TRUE)); + return $this->set('amount', $label, filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION)); } /** -- 2.25.1