I'm not at all a software developer and I need to know how can I average a set of values of one row in a DotNetNuke table inside of Form and List Module. I have tried using this for the expression:
'AVG('+[Num1]+','+[Num2]+','+[Num3]+')'
but this only returns concatenated: AVG(10,20,30) after I set the values of 10,20,30.
Anyone ideas?
$(document).ready(function()
{ $("#budgetWorksheet tbody tr").change(rowAverage); });
function rowAverage() { var totalAvg = 0; $("tbody tr").slice(0,-1).each(function()
{ var row_total = 0; var i = "td:not(.subtotal) input:text",
this).each(function() { row_total += parseInt(this.value || 0, 10);
}).length; if (row_total > 0) { var avg = Math.floor(parseInt(row_total, 10) /
i); $(".subtotal input:text", this).val(avg); totalAvg += avg; } });
$(.totalAvg input").val(totalAvg);