• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

The value entered does not match the format of the field

New Here ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

Please help! I am fairly new with using adobe and creating javascript equations. I have run into the error that many new user have, the dreaded "The value entered does not match the format of the field" pop-up. This only occurs when the value answer is 0... 

I am creating a till balance form for a retail company, so having that 0 value show is important and fairly frequent, as you want the till to show 0 variance. 

Indi5FC6_0-1616531705708.png

Here are the columns Cash(Counted) = AMCash
Cash on Shift Report = AMPOSCash 

For the Cash +/- I have a Simplified Field Notation set as AMCash-AMPOSCash 
The format is Number to the second decimal point, which I need since we are talking money.
It does the math just fine, but I meet an error when the total is 0 for that column. 

I have spent so long on trying to get this to function properly. Please help me if you can!!! Thank you! 

TOPICS
Create PDFs , Edit and convert PDFs , General troubleshooting , JavaScript , PDF forms

Views

6.4K

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 , Mar 25, 2021 Mar 25, 2021

OK, now that you've (finally) provided a concrete example I was able to reproduce it.

This is happening due to a rounding issue. The value of "AMCash" is not really 91.58, but 91.58000000000001. And when you subtract 91.58 from that you get this value in "AM Cash Variance": 1.4210854715202004e-14

This value can't be shown by the Number format, which causes the error. You would have seen all of this if you had just removed the Number format from your fields.

Anyway, the solution is to round the r

...

Votes

Translate

Translate
Community Expert ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

This example is wrong.

Votes

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 ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

Okay Bernd, do you have a proper solution then? 

Votes

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
Community Expert ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

Where does you use a division?

Votes

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 ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

I don't. 

Votes

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
Community Expert ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

Here is an article on this very topic. It includes possible fixes:

 

https://www.pdfscripting.com/public/Value-Entered-Does-Not-Match-Format.cfm?sd=40

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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 ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

Thank you- I've been looking at this but I'm afraid I don't quite have the javascript knowledge to create my own customized scripting. 😞 

Votes

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 ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

Could you help me? Looking at this site was like reading another language. 

Votes

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
Community Expert ,
Mar 25, 2021 Mar 25, 2021

Copy link to clipboard

Copied

There is no calculation at the field.

Bild2.jpg

Votes

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 ,
Mar 25, 2021 Mar 25, 2021

Copy link to clipboard

Copied

I reattached... here it is again, not sure why it isn't showing but this definitely has the calculation. 

Votes

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 ,
Mar 25, 2021 Mar 25, 2021

Copy link to clipboard

Copied

thank you for looking. 

Votes

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
Community Expert ,
Mar 25, 2021 Mar 25, 2021

Copy link to clipboard

Copied

You now have two overlapping fields, one called "AM Cash Variance" and one "AM Cash +/-"...

Both with the same calculation, but it's not good practice. Still, the only errors I'm getting are:

TypeError: f is null

There's nothing about the format being incorrect, as expected.

Votes

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
Community Expert ,
Mar 25, 2021 Mar 25, 2021

Copy link to clipboard

Copied

I get also f is null.

Votes

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 ,
Mar 25, 2021 Mar 25, 2021

Copy link to clipboard

Copied

Really not sure how you both are getting different error messages than me. This is when I am out of preview/edit mode and accessing the form like someone with standard access. 

@try67 @Bernd Alheit 

Votes

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
Community Expert ,
Mar 25, 2021 Mar 25, 2021

Copy link to clipboard

Copied

LATEST

OK, now that you've (finally) provided a concrete example I was able to reproduce it.

This is happening due to a rounding issue. The value of "AMCash" is not really 91.58, but 91.58000000000001. And when you subtract 91.58 from that you get this value in "AM Cash Variance": 1.4210854715202004e-14

This value can't be shown by the Number format, which causes the error. You would have seen all of this if you had just removed the Number format from your fields.

Anyway, the solution is to round the results of your calculations. To do so you would need to use a script.

For example, for AMCash you can use the following:

 

 

var v1 = Number(this.getField("BTotal").valueAsString);
var v2 = Number(this.getField("ATotal").valueAsString);
event.value = (v1-v2).toFixed(2);

 

Votes

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