hello, i'm having a problem with a mildly complex calculation. what i want to have happen is this:
if Acrobatics3 is less than or equal to 4, skillCost equals 1. if Acrobatics3 is greater than 4 and less than or equal to 8, skillCost equals 2. (and so on, with skillCost going up 1 point for every 4 points in Acrobatics3).
the code i've been trying to get to work is the following:
var acr = this.getField("Acrobatics3");
var skc = acr / 4;
if (acr % 4 == 0) event.value = skc;
else event.value = skc + 1;
i have to note that my understanding of javascript is fairly limited, and i feel like i'm missing something glaringly obvious. i was told by a few people that using the modulus operator would solve my problem, and i'm pretty sure i have the logic right. the error i get is that the code doesn't match the format of the field - but the text fields involved are formatted as numbers. when i tried using Math.floor, the error was gone but the code still didn't work. the code is in the custom calculation field of skillCost. what am i doing wrong?
thank you ahead of time.
George Kaiser