Copy link to clipboard
Copied
I have set up a text field to properly calculate and display a number on a scale ranging from 1.00 to 4.00. Now, using a "Custom Format Script" in the FORMAT TAB, I would like the field to display the following text: BRONZE for values ranging from 1.00 to 2.39; SILVER for 2.40 to 3.39; GOLD for 3.40 to 4.00. Any suggestions?
Use this code:
if (event.value>1 && event.value<2.39) event.value = "BRONZE";
else if (event.value>=2.4 && event.value<3.39) event.value = "SILVER";
else if (event.value>=3.4 && event.value<=4) event.value = "GOLD";
Copy link to clipboard
Copied
Use this code:
if (event.value>1 && event.value<2.39) event.value = "BRONZE";
else if (event.value>=2.4 && event.value<3.39) event.value = "SILVER";
else if (event.value>=3.4 && event.value<=4) event.value = "GOLD";
Copy link to clipboard
Copied
Works great! I did end up changing the value of 1 in the first line to .5 because (since I was using averages), when 4 radio buttons that equal "1" were simultaneously selected it would display 1 instead of "Bronze," but as I said, changing the "1" in the first line to .5 solved that. -hope that makes sense. THANKS for your time!