I am trying to calculate a final figure from 3 sources and keep getting syntax errors. Text field 1 (TF1) is a dollar amount, Text field 2 (TF2) is a % and Text field 3 (TF3)is $ amount as well. My final calculation should represent (TF1 * (TF2/2)) + TF3 = result. I have used the custom code in the format tabs to have the numbers shown as $ or %, but can't get the calculation script to work. I have
var a = get.thisField(TF1).value;
var b = get.thisField(TF2).value;
var c = get.thisField(TF3).value;
event.value = (a * (b/2) + c;
How would I get this to calculate correctly? The final result should look something like this:
TF1 = $100,000
TF2 = 10%
TF3 = $500
Result should be (100,000*(.10/2))+500 = $5,500
Any help would be greatly appreciated.