Percentage Difference
I am trying to calculate the percent difference between two numbers whether it is greater than the original number or less than the original number. My Original Number is "A1" and by new number is "A2". The formula I am using is :
event.value = Math.abs(Number(this.getField("A1").valueAsString) / Number(this.getField("A2").valueAsString));
This works correctly if A2 is greater than A1 but if it is less than A2 it does not
1. A1= 16,000 A2=17,456 Outcome is 91.66%
2. A1= 16,000 A2=14,500 Outcome is 110.34% (Should be 90.625%)
Any help with be greatly appreciated, thank you.