diff --git a/CRM/Extrafee/Fee.php b/CRM/Extrafee/Fee.php index a5b3a29..82c4a60 100644 --- a/CRM/Extrafee/Fee.php +++ b/CRM/Extrafee/Fee.php @@ -64,12 +64,12 @@ public static function modifyTotalAmountInParams($formName, &$form, $extraFeeSet if ($formName == 'CRM_Contribute_Form_Contribution_Main') { if (!empty($form->_amount)) { $form->_amount += $form->_amount * $percent/100 + $processingFee; - $form->_amount = number_format($form->_amount, 2); + $form->_amount = round(CRM_Utils_Rule::cleanMoney($form->_amount), 2); $form->set('amount', $form->_amount); } elseif ($amt = $form->get('amount')) { $form->_amount = $amt + $amt * $percent/100 + $processingFee; - $form->_amount = number_format($form->_amount, 2); + $form->_amount = round(CRM_Utils_Rule::cleanMoney($form->_amount), 2); $form->set('amount', $form->_amount); } } @@ -77,7 +77,7 @@ public static function modifyTotalAmountInParams($formName, &$form, $extraFeeSet $params = $form->getVar('_params'); if (!empty($params[0]['amount'])) { $params[0]['amount'] += $params[0]['amount'] * $percent/100 + $processingFee; - $params[0]['amount'] = number_format($params[0]['amount'], 2); + $params[0]['amount'] = round(CRM_Utils_Rule::cleanMoney($params[0]['amount']), 2); $form->setVar('_params', $params); $form->set('params', $params); }