From b81f42da6c0b6422800414c3afa93d653e1755c3 Mon Sep 17 00:00:00 2001 From: atif-shaikh Date: Fri, 30 Jan 2015 19:25:02 +0530 Subject: [PATCH] CRM-15835 - Event registrations total amounts with decimals stored incorrectly when CiviCRM thousands separator is a dot https://issues.civicrm.org/jira/browse/CRM-15835 --- CRM/Utils/Rule.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Rule.php b/CRM/Utils/Rule.php index 30d49df23a..dec94a40b6 100644 --- a/CRM/Utils/Rule.php +++ b/CRM/Utils/Rule.php @@ -443,7 +443,9 @@ class CRM_Utils_Rule { // ugly fix for CRM-6391: do not drop the thousand separator if // it looks like it’s separating decimal part (because a given // value undergoes a second cleanMoney() call, for example) - if ($mon_thousands_sep != '.' or substr($value, -3, 1) != '.') { + // CRM-15835 - in case the amount/value contains 0 after decimal + // eg 150.5 the following if condition will pass + if ($mon_thousands_sep != '.' or (substr($value, -3, 1) != '.' && substr($value, -2, 1) != '.')) { $value = str_replace($mon_thousands_sep, '', $value); } -- 2.25.1