Skip to main content
Participant
September 1, 2022
Answered

Error The value entered does not match the format or the field [%OfRateChg].

  • September 1, 2022
  • 1 reply
  • 1344 views

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

This topic has been closed for replies.
Correct answer Nesa Nurani

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;

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
September 1, 2022

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;

Participant
September 1, 2022

Thank you so much, That worked.