How to code if else in a function
-
Hi, I am trying to do a calculations using a Calculated Field after pressing the calculate button. Here is what I have so far:
(function(){
var cal = 0;
IF(fieldname5==1) return (cal = (10*(fieldname8*0.454)+6.25*(((fieldname6*12)+fieldname7)*2.54)-5*fieldname2+5) );
IF(fieldname5==2) return (cal = (10*(fieldname8*0.454)+6.25*(((fieldname6*12)+fieldname7)*2.54)-5*fieldname2-161) );
})();
I want to calculate and save the result in cal based on the users selection. I want to save the result in cal and display it to the user and also use it in later calculations, how can I do that?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to code if else in a function’ is closed to new replies.