1 Reply Latest reply on Apr 15, 2015 8:01 PM by bpwhistler

    changing calculation result to negative

    bpwhistler

      I have a custom calculation script in an Acrobat form field:

      var myFormat = "mm/dd/yyyy"

      var startDt = this.getField("PolicyEffectiveDate").value
      var endDt = this.getField("ChngDate").value

      var startDate = util.scand(myFormat,startDt);
      var endDate = util.scand(myFormat,endDt);

      var xdays = Math.round(Math.abs((startDate.getTime() - endDate.getTime())/(86400000)))

      event.value =  ((365 - (xdays)) / 365).toFixed(3) * (this.getField("AnnualPremium2").value)

       

      How would I change the resulting calculation total to negative?

       

      Thanks in advance for any help!