Calculated values not calculating correctly all every time
If written the following script and I've found that it's working some of the time but not all of the time. For example when I have the size as 1/6 and the cost anywhere from 275-396 the value should be 7.00 but it puts it as 5.00. When I type 397 it changes to 7.00. I can't determine why it's not calculating correctly every time.
var size=(this.getField("KegSize").value);
var cost=Number(this.getField("KegCost").value);
var ABV=Number(this.getField("ABV").value);
if (size="1/6")var product1=Number(cost/640);
if (size="1/4")var product2=Number(cost/992);
if (size="1/2")var product3=Number(cost/1984);
if ((ABV>1)&&(product1>.2))event.value="7.00"; else if ((ABV>1)&&(product1<.2))event.value="5.00"; else if (ABV<1) event.value="";
if ((ABV>1)&&(product2>.2))event.value="7.00"; else if ((ABV>1)&&(product2<.2))event.value="5.00"; else if (ABV<1) event.value="";
if ((ABV>1)&&(product3>.2))event.value="7.00"; else if ((ABV>1)&&(product3<.2))event.value="5.00"; else if (ABV<1) event.value="";//
