From: atif-shaikh Date: Fri, 30 Jan 2015 13:55:02 +0000 (+0530) Subject: CRM-15835 - Event registrations total amounts with decimals stored incorrectly when... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b81f42da6c0b6422800414c3afa93d653e1755c3;p=civicrm-core.git 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 --- 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); }