adding two variables together
- by James Trusler
I have been trying for... about 4 hours now lmao.
currentCalc returns 50
currentSum returns 0 when i alert them. Yet I cannot add them together with parseInt????
what am i doing wrong :'(
var identRow = $('tr.identRow');
identRow.each(
function(){
var getIdentClass = $(this).attr('class').split(' ').slice(1);
$('tr.ohp' + getIdentClass + ' td.EURm').each(
function(index){
var currentCalc = parseInt($(this).text().replace('.',''), 10);
var currentSum = $('tr.' + getIdentClass + ' td.totalEURm', this).text().replace('.','');
total = parseInt(currentCalc, 10) + parseInt(currentSum, 10);
$('tr.' + getIdentClass + ' td.totalEURm').text(total);
if (index==6){
alert(total);
}
}
);
}
);