mariya
04-16-2007, 03:14 PM
hi all,
I am having some trouble with a function that adds up 10 values and sees whether the sum is 100. It does not seem to add correctly, can you possibly help?
function doesAddUp(field1, field2, field3, field4,
field5, field6, field7, field8, field9, field10)
{
if (field1 + field2 + field3 + field4 + field5 + field6 + field7 + field8 + field9 + field10 != 100)
{ err = "Your total is not 100";}
else {err = false;}
return err;
}
Many many thanks!
mariya
I am having some trouble with a function that adds up 10 values and sees whether the sum is 100. It does not seem to add correctly, can you possibly help?
function doesAddUp(field1, field2, field3, field4,
field5, field6, field7, field8, field9, field10)
{
if (field1 + field2 + field3 + field4 + field5 + field6 + field7 + field8 + field9 + field10 != 100)
{ err = "Your total is not 100";}
else {err = false;}
return err;
}
Many many thanks!
mariya