Copy link to clipboard
Copied
I am trying to get the percentage between two rates. My formula works but I keep the following error message when I clear the form or move to another field, "The value entered does not match the format or the field [%OfRateChg]. I am using the simplified field notation and my formula is (NewRate-CurrentRate)/(CurrentRate). My Current Rate and New Rate are set as Numbers and the %OfRateChg is set as Percentage. Does anyone know how to solve this. I have never used the calculations befor so this is all new to me. I appriacate any help.
Thank You,
Rebecca
That's because Simplified field notation is calculating even if fields are 0 or empty, and you can't divide with 0, try this as custom calculation script:
var a = this.getField("NewRate").value;
var b = this.getField("CurrentRate").value;
if(a&&b)
event.value = (a-b)/b;
else
event.value = 0;
Copy link to clipboard
Copied
That's because Simplified field notation is calculating even if fields are 0 or empty, and you can't divide with 0, try this as custom calculation script:
var a = this.getField("NewRate").value;
var b = this.getField("CurrentRate").value;
if(a&&b)
event.value = (a-b)/b;
else
event.value = 0;
Copy link to clipboard
Copied
Thank you so much, That worked.