This is probably really simple, but I'm struggling.
I have fields t2, t5, and total.0.
If t2 is null or zero, I want total.0 to not show with anything (blank).
If t2 does have a number in, then t2-t5 with the total going into total.0.
Put the following code into the custom calculation script for "total.0". Be sure it's not formatted to be a number or you'll get a zero as the appearance. Note: Empty fields in PDF are never null, they're empty strings.
if (this.getField("t2").value == "" || this.getField("t2").value == 0) {
event.value = ""
}
else {
event.value = this.getField("t2").value - this.getField("t5").value
}