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

Problem with calculated field in Google Chrome

Community Beginner ,
Feb 02, 2024 Feb 02, 2024

Copy link to clipboard

Copied

Hi

 

I have a problem with a calculated field in a adobe document that works in the adobe app but not when the document is opened in Google Chrome.

 

I seems like when the adobe document is opened in Google Chrome and I start to fill out the fields with a number with comma the calculated field thinks the number 10,00 is 100. When I open the document ind Adobe it works perfectly fine.

 

I have tried the custom format script event.value "= event.value.replace(",",".");" I found in another subject.

 

Can anyone help with this?

TOPICS
How to , PDF , PDF forms

Views

248

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 ,
Feb 02, 2024 Feb 02, 2024

Copy link to clipboard

Copied

Browsers may not support scripts.

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 Beginner ,
Feb 02, 2024 Feb 02, 2024

Copy link to clipboard

Copied

The calculated field works in the browser but it is reading the number wrong when number contains a comma.

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 ,
Feb 02, 2024 Feb 02, 2024

Copy link to clipboard

Copied

Try changing separator style (dot as decimal, not comma).

When you set field format as Number under 'Separator style' select first option.

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 Beginner ,
Feb 02, 2024 Feb 02, 2024

Copy link to clipboard

Copied

It calculated field works dot. However in Denmark we use comma to separate numbers. Is it possible write scprit that convert det comma to a dot so the calculated field is calculated correct?

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 ,
Feb 02, 2024 Feb 02, 2024

Copy link to clipboard

Copied

You can try this workaround, use this as validate script:

var str = event.value;
if(str) {
str = str.replace(",", ".");
event.value = str;}

If you enter a number like this 10,5 it will convert the actual value to 10.5, then use this as custom format script to show comma as decimal and dot as a thousand separator while actual value will remain with dot as decimal separator:

var n = event.value;
if(n)
event.value = util.printf("%2.2f", n);

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 Beginner ,
Feb 02, 2024 Feb 02, 2024

Copy link to clipboard

Copied

Hmm cant get the workaround to work 😞 but I can read that others have similiar problems calculated fields when filling documents in a browser. 

 

https://community.adobe.com/t5/acrobat-sdk-discussions/multiplication-problem-with-comma-and-point/m...

 

Thank you for your effort.

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 ,
Feb 02, 2024 Feb 02, 2024

Copy link to clipboard

Copied

LATEST

Like was said, browser plugins have very poor support for scripts.

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