From 3bdb644f34a0c9bcc35d4c2241c952f27999a7de Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 28 Oct 2013 11:32:30 -0700 Subject: [PATCH] js - add comments for CRM.formatMoney --- js/Common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/Common.js b/js/Common.js index efd5140b2c..e5d14fef7f 100644 --- a/js/Common.js +++ b/js/Common.js @@ -884,8 +884,9 @@ CRM.validate = CRM.validate || { /** * Clientside currency formatting * @param value - * @param format + * @param format - currency representation of the number 1234.56 * @return string + * @see CRM_Core_Resources::addCoreResources */ var currencyTemplate; CRM.formatMoney = function(value, format) { @@ -904,7 +905,6 @@ CRM.validate = CRM.validate || { sign = (value < 0) ? '-' : ''; //extracting the absolute value of the integer part of the number and converting to string i = parseInt(value = Math.abs(value).toFixed(2)) + ''; - j = ((j = i.length) > 3) ? j % 3 : 0; result = sign + (j ? i.substr(0, j) + separator : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + separator) + (2 ? decimal + Math.abs(value - i).toFixed(2).slice(2) : ''); return format.replace(/1.*234.*56/, result); -- 2.25.1