Copy link to clipboard
Copied
I am trying to create a GPA calculator, so I want to assign a number value to letters. For ex. A=4, B=3, C=2, D=1, and F=0.
I will then multiple the credit hours by the letter. For ex. 3 x B = 9.
I understand how to do the calculations in the cells, but what I need help with is assigning a number value to the letters before completing a calculation.
Thanks.
Copy link to clipboard
Copied
var v = this.getField("Score").value;
if (v=="") event.value = "";
else {
if (v=="A") event.value = 4;
else if (v=="B") event.value = 3;
else if (v=="C") event.value = 2;
else if (v=="D") event.value = 1;
else if (v=="F") event.value = 0;
}
Copy link to clipboard
Copied
Where would I enter the Javascript?
Copy link to clipboard
Copied
Using a drop down field for each course and using the Grade letter for the Item and assigning the weighting or number value to the Option would then cause the value of the drop down field to be the numeric value when the letter grade was selected. You can then use any of the filed calculation options to calculate the average.
Copy link to clipboard
Copied
gkaiseril​ This helped a lot! Got everything I need! Thank you!