@@ -64,20 +64,20 @@ public static function modifyTotalAmountInParams($formName, &$form, $extraFeeSet
64
64
if ($ formName == 'CRM_Contribute_Form_Contribution_Main ' ) {
65
65
if (!empty ($ form ->_amount )) {
66
66
$ form ->_amount += $ form ->_amount * $ percent /100 + $ processingFee ;
67
- $ form ->_amount = number_format ( $ form ->_amount , 2 );
67
+ $ form ->_amount = round (CRM_Utils_Rule:: cleanMoney ( $ form ->_amount ) , 2 );
68
68
$ form ->set ('amount ' , $ form ->_amount );
69
69
}
70
70
elseif ($ amt = $ form ->get ('amount ' )) {
71
71
$ form ->_amount = $ amt + $ amt * $ percent /100 + $ processingFee ;
72
- $ form ->_amount = number_format ( $ form ->_amount , 2 );
72
+ $ form ->_amount = round (CRM_Utils_Rule:: cleanMoney ( $ form ->_amount ) , 2 );
73
73
$ form ->set ('amount ' , $ form ->_amount );
74
74
}
75
75
}
76
76
elseif ($ formName == 'CRM_Event_Form_Registration_Register ' ) {
77
77
$ params = $ form ->getVar ('_params ' );
78
78
if (!empty ($ params [0 ]['amount ' ])) {
79
79
$ params [0 ]['amount ' ] += $ params [0 ]['amount ' ] * $ percent /100 + $ processingFee ;
80
- $ params [0 ]['amount ' ] = number_format ( $ params [0 ]['amount ' ], 2 );
80
+ $ params [0 ]['amount ' ] = round (CRM_Utils_Rule:: cleanMoney ( $ params [0 ]['amount ' ]) , 2 );
81
81
$ form ->setVar ('_params ' , $ params );
82
82
$ form ->set ('params ' , $ params );
83
83
}
0 commit comments