function dp(price) 
{
   string = "" + price;
   number = string.length - string.indexOf('.');
   if (string.indexOf('.') == -1)
      return string + '.0';
   if (number == 1)
      return string + '0';
   if (number == 2)
      return string + '0';
   if (number > 3)
      return string.substring(0,string.length-number+1);
return string;
}

function calculate()
{
document.calcform.breakfastquantity.value = dp(eval(document.calcform.food1total.value) + eval(document.calcform.food2total.value) + eval(document.calcform.food3total.value) + eval(document.calcform.food4total.value))
document.calcform.msnackquantity.value = dp(eval(document.calcform.msnack1total.value) + eval(document.calcform.msnack2total.value) + eval(document.calcform.msnack3total.value) + eval(document.calcform.msnack4total.value))
document.calcform.lunchquantity.value = dp(eval(document.calcform.lunch1total.value) + eval(document.calcform.lunch2total.value) + eval(document.calcform.lunch3total.value) + eval(document.calcform.lunch4total.value))
document.calcform.asnackquantity.value = dp(eval(document.calcform.asnack1total.value) + eval(document.calcform.asnack2total.value) + eval(document.calcform.asnack3total.value) + eval(document.calcform.asnack4total.value))
document.calcform.dinnerquantity.value = dp(eval(document.calcform.dinner1total.value) + eval(document.calcform.dinner2total.value) + eval(document.calcform.dinner3total.value) + eval(document.calcform.dinner4total.value))
document.calcform.totalquantity.value = dp(eval(document.calcform.breakfastquantity.value) + eval(document.calcform.msnackquantity.value) + eval(document.calcform.lunchquantity.value) + eval(document.calcform.asnackquantity.value) + eval(document.calcform.dinnerquantity.value))
document.calcform.breakfastfquantity.value = dp(eval(document.calcform.food1ftotal.value) + eval(document.calcform.food2ftotal.value) + eval(document.calcform.food3ftotal.value) + eval(document.calcform.food4ftotal.value))
document.calcform.msnackfquantity.value = dp(eval(document.calcform.msnack1ftotal.value) + eval(document.calcform.msnack2ftotal.value) + eval(document.calcform.msnack3ftotal.value) + eval(document.calcform.msnack4ftotal.value))
document.calcform.lunchfquantity.value = dp(eval(document.calcform.lunch1ftotal.value) + eval(document.calcform.lunch2ftotal.value) + eval(document.calcform.lunch3ftotal.value) + eval(document.calcform.lunch4ftotal.value))
document.calcform.asnackfquantity.value = dp(eval(document.calcform.asnack1ftotal.value) + eval(document.calcform.asnack2ftotal.value) + eval(document.calcform.asnack3ftotal.value) + eval(document.calcform.asnack4ftotal.value))
document.calcform.dinnerfquantity.value = dp(eval(document.calcform.dinner1ftotal.value) + eval(document.calcform.dinner2ftotal.value) + eval(document.calcform.dinner3ftotal.value) + eval(document.calcform.dinner4ftotal.value))
document.calcform.totalfquantity.value = dp(eval(document.calcform.breakfastfquantity.value) + eval(document.calcform.msnackfquantity.value) + eval(document.calcform.lunchfquantity.value) + eval(document.calcform.asnackfquantity.value) + eval(document.calcform.dinnerfquantity.value))
}
