What is wrong with this code?

What is wrong with this code?

I am new to Zoho


Last_Purch_Price, Sup_Cost_Factor, & DPI_Cost are decimal fields, Units_in_Purch is a number field In the same form.


I want to calculate the DPI_Cost, but only if there are valid values in the 3 fields needed for the calculation


I tried to enter this code in the On User Input field action of the DPI_Cost field:

if(input.Last_Purch_Price != null && input.Sup_Cost_Factor != null && input.Units_in_Purch != null)

{

input.DPI_Cost = ((input.Last_Purch_Price * input.Sup_Cost_Factor ) / input.Units_in_Purch));

}

And got the error message:

Error at line number : 1
Improper Statement
Error might be due to missing ';' at end of the line or incomplete expression


I changed the first line to:

if(input.Last_Purch_Price > 0 && input.Sup_Cost_Factor > 0 && input.Units_in_Purch > 0)

But got the same error message.

 

What am I doing wrong?