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

Multiple currency symbols

Community Beginner ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

Hi,

 

I have a column on a document that autosums all the numbers in it in the bottom cell (image attached).

Sometimes this form is filled out for figures in pounds sterling(£) and sometimes in Euro(€).

 

Is it possible to have whatever currency symbol I enter in the rows appear in the autosum total at the end. For example if I start entering amounts with a £, the autosum cell will have a £ and vice versa for €.

 

Note: The rows never deal with mixed currency, it is always either one or the other.

 

Thanks

 

pdf question.PNG

TOPICS
Create PDFs , How to , JavaScript , Modern Acrobat , PDF , PDF forms

Views

342

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 ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

The fields are not formatted to currency?

Wouldn't be easier to have a checkbox to switch between currency or even better two radio buttons?

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 ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

Thanks. Check boxes or a dropdown would work as a placholder for now but ideally it would just take whatever currency sybol the user entered in the cell and copy it down to the autosum cell

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 ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

There is a lot of info missing from your post, but I assume you manually enter the currency sign and that it's on the left of the value, also if the first field in the column would always be populated it would be enough to check only that field for sign.

Let's say that field name is "Text1", you would use something like this as custom format script of total field:

var text1 = this.getField("Text1").valueAsString;
var cur = text1.charAt(0);
event.value = util.printf(cur+" %,0.2f",event.value);

This is just a basic script, it can be updated to check if the first character is actually a currency sign...etc

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 ,
Jan 30, 2024 Jan 30, 2024

Copy link to clipboard

Copied

LATEST

Thanks. Yes you are  correct the values are entered along with the currency symbol manually row by row. I will try your script and let you know how it goes.

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 ,
Jan 29, 2024 Jan 29, 2024

Copy link to clipboard

Copied

Normally, the currency symbol is added automatically by the field's Format script. That way the user doesn't have to bother entering it each time, and it's much easier to sum fields up, for example.

I would recommend using a single drop-down field for currency selection. A custom-made script can then format the values entered by the user into the amount fields based on that selection.

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