Can someone please help me with my custom calculation script that isn't working correctly?
Hi!
I'm using Adobe Acrobat Standard and I'm trying to write a custom calculation script but I'm missing something which is causing a wrong value to return.
This is the calculation script:
var v1 = 1 * this.getField("FIELD23").value;
var v2 = 1 * this.getField("FIELD32").value;
var v3 = 1 * this.getField("FIELD33").value;
var v4 = 1 * this.getField("FIELD42").value;
var v5 = 1 * this.getField("FIELD43").value;
var v6 = 1 * this.getField("FIELD34").value;
event.value = [(v3 * v1) * (v2)] + [(v5 * v1) * (v4)] + [(v6) * (v2 + v4)]
This is what the variables equal:
v1 = 60%
v2 = 8
v3 = $20
v4 = 8
v5 = $30
v6 = $5
It needs to calculate as follows:
20 (v3) x 60% (v1) = $12 * 8 (v2) = $96 +
30 (v5) * 60% (v1) = $18 * 8 (v4) = $144 +
5 (v6) * 8 (v2) + 8 (v4) = $80
The total should be $320 but I keep getting $9,614,480.
Can anyone help me please, please, please (before all the hair on my head is gone)? Where am I going wrong?
Thank you so much!!
Diane
