0 Replies Latest reply on May 4, 2015 2:06 PM by Nexent1

    Return only even number values in calculations

    Nexent1 Level 1

      I need to calculate the difference between two numbers and return only even values rounded to 2 decimal places.  The result can only be positive so I also need to return the absolute value.  The basic math I am trying to use is Abs(Round ((Field1 - Field2)/2,2)*2.  I am struggling with the JavaScript for this math.  I am using the following and not sure where I am going wrong.

       

      event.value = util.printf("%.2f",Math.abs(Math.round(((this.getField("Field1").value - this.getField("Field1").value)/2),4)*2));

       

      Any help is appreciated.

       

      Robert