Multiply Child table value with a fixed value

Hello Guys

I have added some values to the child table and used code to get the sum of values and set it to a field in the doc. and I want to multiply the total with 12

const t=[]
var f=0
frappe.ui.form.on(‘Salary Details’, {
amount(frm,cdt,cdn){
var d = locals[cdt][cdn];
var i=d.idx-1;
t[i]=d.amount;
console.log(“full array “+t);
var sum = 0;
for (let n = 0; n < t.length; n++)
{
var f=flt(t[n]);
var sum =sum+f;
}
console.log(sum,“fffffffffffffffd”)
frm.set_value(“total”,sum);
var amount = t[i]* 12
console.log(amount,”…”)
},

})

Please help me