1 Reply Latest reply on Aug 9, 2013 1:50 PM by Genevieve Laroche

    Calculations formating


      I'm new to this. I'm taken one of our registration forms that was created in Publisher and I'm working with it in Adobe Forms. There are fee calculations on the form that were returning zeros and we didn't want those to show on the form, if someone just wanted to print a blank form and not use the fillable form. We found some online code to use to remove the zero and leave blank, which it is now doing and the calcuation returns correctly as a number, but we would like the sum to format with a $ sign and two decimals and don't know how to do that. Below is the code I found to remove the zero and leave blank if zero. If someone could tell us how to format the sum with a dollar sign and two decimals - much appreciated.


      // Get field values, as numbers

      var v1 = +getField("Fee1).value;

      var v2 = +getField("Fee2).value;

      var v3 = +getField("Fee3).value;

      var v4 = +getField("Fee4).value;


      //perform the addition

      var sum = v1 + v2 + v3 + v4:


      // Set this field value

      if (sum !== 0) {


      event.value = sum


      } else {


      // Blank this field

      event.value = "";