Copy link to clipboard
Copied
Struggling to make this work. I need a calculated field to solve the following problem:
5. Claimed compensation (line 4). Deduct 1.75% of the first $1,000 and 1.5%of the amount in excess of $1,000 with a $50 cap. (Total compensation may not exceed $50.).
I'm "code stupid", so any help someone could provide would be appreciated.
Copy link to clipboard
Copied
What are the field names included in this calculation?
Copy link to clipboard
Copied
This particular field is named "ClaimedCompensation". The field before this is entitled "GrossKentuckySalesAndUseTax"
Copy link to clipboard
Copied
You can use this code as the custom calculation script of the cap field:
var cap = 0;
var maxCap = 50;
var amount = Number(this.getField("GrossKentuckySalesAndUseTax").valueAsString);
if (amount>1000) {
cap+=1000*0.0175;
amount-=1000;
cap+=amount*0.015;
} else cap+=amount*0.0175;
event.value = Math.min(cap, maxCap);
Copy link to clipboard
Copied
This worked great! Thanks so much.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more