Let's assume you have two fields - one contains the result of your calculation (let's call this Rating) and the second one contains the textual representation of that rating (called e.g. RatingText). Go into the properties of your RatingText field and bring up the Calculation tab, then select to create a custom calculation script and use the following script:
var n = this.getField("Rating").value;
if (n < 1.50) {
event.value = "Unacceptable";
}
else if (n >= 1.50 && n < 2.5) {
event.value = "Needs Improvement";
}
else if (n >= 2.5 && n < 3.5) {
event.value = "Meets Expectations";
}
else if (n >= 3.5 && n < 4.5) {
event.value = "Exceeds Expectations";
}
else if (n >= 4.5) {
event.value = "Outstanding";
}
You will notice, that I am not using the 1.49, 2.49, 3.49 and 4.49 values - I am testing to see if the value is smaller than e.g. 1.5. That also covers 1.499 and 1.4999 and so on. Anything that is below 1.5 will be treated as Unacceptable. Once the average hits 1.5, we will treat it as the next category up.
Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com