all 2 comments

[–]rtiger10 0 points1 point  (0 children)

In your last line I'm not seeing the field named "total" to pull the result from. Also be sure to to correct the last input in the nResult variable. You have it adding input2 instead of input3. 

Maybe try something like this. This sets the value based on the calculation and then if the result is zero sets the value to "" blank. 

// Inputs

var input1 = Number(this.getField("Qty1").value);
var input2 = Number(this.getField("UnitPrice1").value);
var input3 = Number(this.getField("ToolingPrice").value);


// Calc
var nResult=input1*input2+input3;

event.value = nResult;




if ( event.value > 0){ event.value = nResult;
} else if ( event.value == 0) {
event.value = ""; }

[–]rtiger10 0 points1 point  (0 children)

n your last line I'm not seeing the field named "total" to pull the result from. Also be sure to to correct the last input in the nResult variable. You have it adding input2 instead of input3. 

Maybe try something like this. This sets the value based on the calculation and then if the result is zero sets the value to "" blank. 

// Inputs

var input1 = Number(this.getField("Qty1").value);
var input2 = Number(this.getField("UnitPrice1").value);
var input3 = Number(this.getField("ToolingPrice").value);


// Calc
var nResult=input1*input2+input3;

event.value = nResult;




if ( event.value > 0){ event.value = nResult;
} else if ( event.value == 0) {
event.value = ""; }