		function perRound(num, precision) {
					var precision = 3; //default value if not passed from caller, change if desired
					// remark if passed from caller
					precision = parseInt(precision); // make certain the decimal precision is an integer
					var result1 = num * Math.pow(10, precision);
					var result2 = Math.round(result1);
					var result3 = result2 / Math.pow(10, precision);
					return zerosPad(result3, precision);
				}

				function zerosPad(rndVal, decPlaces) {
					var valStrg = rndVal.toString(); // Convert the number to a string
					var decLoc = valStrg.indexOf("."); // Locate the decimal point
					// check for a decimal 
					if (decLoc == -1) {
						decPartLen = 0; // If no decimal, then all decimal places will be padded with 0s
						// If decPlaces is greater than zero, add a decimal point
						valStrg += decPlaces > 0 ? "." : "";
					}
					else {
						decPartLen = valStrg.length - decLoc - 1; // If there is a decimal already, only the needed decimal places will be padded with 0s
					}
					 var totalPad = decPlaces - decPartLen;    // Calculate the number of decimal places that need to be padded with 0s
					if (totalPad > 0) {
						// Pad the string with 0s
						for (var cntrVal = 1; cntrVal <= totalPad; cntrVal++) 
							valStrg += "0";
						}
					return valStrg;
				}
				// send the value in as "num" in a variable

				// clears field of default value
				function clear_field(field) {
						if (field.value==field.defaultValue) {
							field.value=''
						}
					}

				// calculate the calories

				function CalcCal() {

				var quantity = eval(document.calcalc.InUnit.value);
				var i = document.calcalc.unit.selectedIndex;
				var thisUnit = eval(document.calcalc.unit.options[i].value);

				var quantity2 = eval(document.calcalc.InUnit2.value);
				var i2 = document.calcalc.unit2.selectedIndex;
				var thisUnit2 = eval(document.calcalc.unit2.options[i2].value);

				var quantity3 = eval(document.calcalc.InUnit3.value);
				var i3 = document.calcalc.unit3.selectedIndex;
				var thisUnit3 = eval(document.calcalc.unit3.options[i3].value);

				var quantity4 = eval(document.calcalc.InUnit4.value);
				var i4 = document.calcalc.unit4.selectedIndex;
				var thisUnit4 = eval(document.calcalc.unit4.options[i4].value);

				var quantity5 = eval(document.calcalc.InUnit5.value);
				var i5 = document.calcalc.unit5.selectedIndex;
				var thisUnit5 = eval(document.calcalc.unit5.options[i5].value);


				document.calcalc.ecals1.value = (thisUnit);
				document.calcalc.ecals2.value = (thisUnit2);
				document.calcalc.ecals3.value = (thisUnit3);
				document.calcalc.ecals4.value = (thisUnit4);
				document.calcalc.ecals5.value = (thisUnit5);
				document.calcalc.cals1.value = (thisUnit) * (quantity);
				document.calcalc.cals2.value = (thisUnit2) * (quantity2);
				document.calcalc.cals3.value = (thisUnit3) * (quantity3);
				document.calcalc.cals4.value = (thisUnit4) * (quantity4);
				document.calcalc.cals5.value = (thisUnit5) * (quantity5);
				document.calcalc.cals.value = ((thisUnit) * (quantity)) + ((thisUnit2) * (quantity2)) + ((thisUnit3) * (quantity3)) + ((thisUnit4) * (quantity4)) + ((thisUnit5) * (quantity5));

				}
	