var epcSum = 0;
var labourSum = 0;
var bvatSum = 0;
var avatSum = 0;
var vatSum = 0;
var discount = 0;
function addToSum(type, amount) {
try {
if(type=='A') epcSum += new Number(amount);
if(type=='B') labourSum += new Number(amount);
if(type=='C') vatSum += new Number(amount);
if(type=='D') discount += new Number(amount);
} catch (e) {}
return '';
}
I am not finding the way how to implement "+=" operator and using the global variable inside function . Please anybody help me to convert this javascript function to XSLT template or function.