2 Replies Latest reply on Feb 13, 2017 11:22 AM by Astoria-Paul

    How do I round up/down calculated fields in Acrobat Pro DC?

    Astoria-Paul Level 1

      I need Javascript for rounding solutions in two calculated fields in an Acrobat Pro DC form (I am almost totally unsavvy about Javascript, well, actually, totally.):

       

      I need to round UP to the next whole number the results in one calculated field whose basic calculation is this:

       

      (*THIS CALCS HOW MANY DAYS A JOB WILL TAKE)

       

      // Get first field value, as a number

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

      // Get second field value, as a number

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

      // Calculate and set this field's value to the result

      event.value = v1 * v2;

      --------------------------------

       

      I need to round DOWN to the next whole number the results in one calculated field whose basic calculation is this:

       

      (THIS CALCS HOW MUCH A JOB WILL COST)

       

      // Get first field value, as a number

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

      // Get second field value, as a number

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

      // Calculate and set this field's value to the result

      event.value = v4 * v3;

       

      I have tried a few copy-and-paste scripts from the web; they did not work, and my efforts to tweak them into working also failed.

       

      I will be eternally grateful for any help I receive.

       

      Thanks,

      Paul

      .