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

New Here ,
Sep 01, 2022 Sep 01, 2022

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

TOPICS
Edit and convert PDFs , How to , JavaScript , PDF forms

Views

29

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 01, 2022 Sep 01, 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;

Likes

Translate

Translate
Community Expert ,
Sep 01, 2022 Sep 01, 2022

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;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2022 Sep 01, 2022

Copy link to clipboard

Copied

LATEST

Thank you so much, That worked. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines