Copy link to clipboard
Copied
How would this Excel formula translate to a custom calculation script in a PDF form?
=IF(A4<=10, 16.68,16.68+((A4-10)*1.67))
Thanks!
You can use this code as the custom calculation script of your field, then:
var v = Number(this.getField("Same_Day_Miles").valueAsString);
if (v<=10) event.value = 16.68;
else event.value =16.68+((v-10)*1.67);
Copy link to clipboard
Copied
What's the name of the "A4" field in the PDF?
Copy link to clipboard
Copied
"Same_Day_Miles"
Copy link to clipboard
Copied
You can use this code as the custom calculation script of your field, then:
var v = Number(this.getField("Same_Day_Miles").valueAsString);
if (v<=10) event.value = 16.68;
else event.value =16.68+((v-10)*1.67);
Copy link to clipboard
Copied
You are a life saver my friend!