2 Replies Latest reply on Jan 15, 2016 1:23 PM by try67

    Hide zero in field with an if/else formula

    CalicoCat5000

      Hi, I’m able to hide the zero in fields when fields have simple calculations, using as the last line:  if (sum !==0) {event.value = sum;} else {event.value = ""}

       

      I have a field named LessRetainage with an if/else formula, and the formula works fine, but I’m not sure how to hide the zero, I’ve tried various versions and the zero still appears, any advice on the syntax of a line that would hide the zero would be appreciated.  Below is the formula:

       

      var Contract = this.getField("TotalContractToDate");

      var TCW = this.getField("TotalCompletedWorkStoredMaterials");

      var Retainage = this.getField("LessRetainage");

      if (TCW.value <=(.5 * Contract.value)) {Retainage.value = .05 * TCW.value} else {Retainage.value = .025 * Contract.value}

       

      Thanks!