Copy link to clipboard
Copied
I am looking to have a formula to calculate both addition and subtraction.
I really want the formula to produce the difference between '"a" and "b"
So if field "b" has a value of 1 more than '"a" it returns a postive, if it is less than "a" to return a negative
Is this possible?
var a = this.getField("WeightOnTag.0.0 ").value;
var b = this.getField("PhysicalWeight.0").value;
event.value = a - b;
Copy link to clipboard
Copied
Yes of course it is possible. You only need to add a conditional to the code you already have.
However, you haven't specified the complete condtions.
diff = b-a
diff > 1 : Postive result
diff < 0 : Negative result
what happens between 0 and 1 ?
Read this:
https://acrobatusers.com/tutorials/conditional-execution/