Código PHP:
function totalpies(obj){///////
var xp1 = obj.totalpies1.value
var xp2 = obj.totalpies2.value
var xp3 = obj.totalpies3.value
var xp4 = obj.totalpies4.value
var xp5 = obj.totalpies5.value
var xp6 = obj.totalpies6.value
var xp7 = obj.totalpies7.value
var xp8 = obj.totalpies8.value
var xp9 = obj.totalpies9.value
var xp10 = obj.totalpies10.value
var xp11 = obj.totalpies11.value
var xp12 = obj.totalpies12.value
var xp13 = obj.totalpies13.value
var xp14 = obj.totalpies14.value
var xp15 = obj.totalpies15.value
var xp16 = obj.totalpies16.value
var xp17 = obj.totalpies17.value
var xp18= obj.totalpies18.value
var xp19 = obj.totalpies19.value
var xp20 = obj.totalpies20.value
var resultado
resultado = (xp1*1) + (xp2 * 1) + (xp3 * 1) + (xp4 * 1) + (xp5* 1) + (xp6* 1) + (xp7* 1) + (xp8* 1) + (xp9* 1) + (xp10* 1) + (xp11* 1) + (xp12* 1) + (xp13* 1) + (xp14* 1) + (xp15* 1) + (xp16* 1) + (xp17* 1) + (xp18* 1) + (xp19* 1) + (xp20* 1);
resultado=resultado*100
resultado=resultado/100
var numero = new oNumero(resultado)
obj.totalpie.value=numero.formato(2, true)
obj.totalpie2.value=numero.formato(2, true)
Gracias