Copy link to clipboard
Copied
I have no idea how to start it out but what I need to accomplish is when distance is greater than 50 then fee is equal to (((distance * 2) - 100) * 0.55) otherwise if distance is equal to or less than 50, then fee is 0. How do I accomplish this in a Javascript calculation?
I've tried this
var d = Number(this.getField("Distance").value);
if (d > 50) event.value = (((d * 2) - 100) * .55);
if (d == 50) event.value = "0";
if (d < 50) event.value = "0"
Try this:
if (d > 50) {
event.value = (d * 2 - 100) * .55;
} else {
event.value = 0;
}
Copy link to clipboard
Copied
Try this:
if (d > 50) {
event.value = (d * 2 - 100) * .55;
} else {
event.value = 0;
}
Copy link to clipboard
Copied
Thank you, again. I'll try this out, too.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now