Fix setAmount should not return localized amount
[civicrm-core.git] / Civi / Payment / PropertyBag.php
index 49a4ea4e8c9975f9c5392638c098b2033a7dc78a..f8817b8c4ecb0ef9ef267bea2957d030e0b04c72 100644 (file)
@@ -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));
   }
 
   /**