// totalfee is monetary, round it to 2 decimal points so it can
// go as a float - CRM-13491
totalfee = Math.round(totalfee*100)/100;
- var totalEventFee = formatMoney( totalfee, 2, separator, thousandMarker);
- document.getElementById('pricevalue').innerHTML = "<b>"+symbol+"</b> "+totalEventFee;
+ var totalFormattedFee = CRM.formatMoney(totalfee);
+ cj('#pricevalue').html(totalFormattedFee);
cj('#total_amount').val( totalfee );
cj('#pricevalue').data('raw-total', totalfee).trigger('change');
}
}
-//money formatting/localization
-function formatMoney (amount, c, d, t) {
-var n = amount,
- c = isNaN(c = Math.abs(c)) ? 2 : c,
- d = d == undefined ? "," : d,
- t = t == undefined ? "." : t, s = n < 0 ? "-" : "",
- i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "",
- j = (j = i.length) > 3 ? j % 3 : 0;
- return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
-}
-
{/literal}
</script>