function cent(amount) {
// returns the amount in the .99 format 
    amount -= 0;
    amount = (Math.round(amount*100))/100;
    return (amount == Math.floor(amount)) ? amount + '.00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
}

function calculate(){
	doc=document.fuelCalcForm
	a=doc.A1.value
	b=doc.B1.value
	c=doc.C1.value
	d=c/(a*b)
	d=d*1000000
	d=Math.round(d*100)/100
	document.getElementById('D1').innerHTML="$"+cent(d)
	a=doc.A2.value
	b=doc.B2.value
	c=doc.C2.value
	d=c/(a*b)
	d=d*1000000
	d=Math.round(d*100)/100
	document.getElementById('D2').innerHTML="$"+cent(d)
	a=doc.A3.value
	b=doc.B3.value
	c=doc.C3.value
	d=c/(a*b)
	d=d*1000000
	document.getElementById('D3').innerHTML="$"+cent(d)
	a=doc.A4.value
	b=doc.B4.value
	c=doc.C4.value
	d=c/(a*b)
	d=d*1000000
	d=Math.round(d*100)/100
	document.getElementById('D4').innerHTML="$"+cent(d)
	a=doc.A5.value
	b=doc.B5.value
	c=doc.C5.value
	d=c/(a*b)
	d=d*1000000
	d=Math.round(d*100)/100
	document.getElementById('D5').innerHTML="$"+cent(d)
	a=doc.A6.value
	b=doc.B6.value
	c=doc.C6.value
	d=c/(a*b)
	d=d*1000000
	d=Math.round(d*100)/100
	document.getElementById('D6').innerHTML="$"+cent(d)
	a=doc.A7.value
	b=doc.B7.value
	c=doc.C7.value
	d=c/(a*b)
	d=d*1000000
	d=Math.round(d*100)/100
	document.getElementById('D7').innerHTML="$"+cent(d)
	a=doc.A8.value
	b=doc.B8.value
	c=doc.C8.value
	d=c/(a*b)
	d=d*1000000
	d=Math.round(d*100)/100
	document.getElementById('D8').innerHTML="$"+cent(d)
	a=doc.A9.value
	b=doc.B9.value
	c=doc.C9.value
	d=c/(a*b)
	d=d*1000000
	d=Math.round(d*100)/100
	document.getElementById('D9').innerHTML="$"+cent(d)
}