104
rated 0 times
[
110]
[
6]
/ answers: 1 / hits: 85261
/ 14 Years ago, tue, june 29, 2010, 12:00:00
I have this function:
function countLitreKgSums(cProductIds){
var cLitreKgSums = new Array();
var cWeek = 0;
for(i=0;i<cProductIds.length;i++){
var cLitreKgSum = 0;
$(#plan_table td[class='week']).each(function(){
cWeek = $(this).html();
var cLitreKgValue = $(input[name*='plan_table_week + cWeek + _prod + cProductIds[i] + _']).val();
if (cLitreKgValue == ) {
cLitreKgValue = 0;
}
cLitreKgValue = cLitreKgValue.replace(/,/g, '.').replace(/[^d.]/g, '').replace(/s/g, '');
cLitreKgValue = parseFloat(cLitreKgValue);
cLitreKgSum += cLitreKgValue;
});
cLitreKgSum = Math.round(cLitreKgSum * 100) / 100;
cLitreKgSums[i] = cLitreKgSum;
}
return cLitreKgSums;
//console.log(cLitreKgSums);
}
I get error message that .replace is not a function but in other functions it works as it should. What is the difference?
More From » jquery