2 Replies Latest reply on Oct 14, 2016 3:27 PM by rb17024267

    Using a conditional statement to compute and assign a value to a field

    rb17024267

      I have no idea how to start it out but what I need to accomplish is when distance is greater than 50 then fee is equal to (((distance * 2) - 100) * 0.55) otherwise if distance is equal to or less than 50, then fee is 0.  How do I accomplish this in a Javascript calculation?

       

      I've tried this

       

      var d = Number(this.getField("Distance").value);

      if (d > 50) event.value = (((d * 2) - 100) * .55);

      if (d == 50) event.value = "0";

      if (d < 50) event.value = "0"