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

Form Field Format adding "x" behind number for Quantity

Participant ,
Feb 25, 2021 Feb 25, 2021

Copy link to clipboard

Copied

Hello again,

 

the title should explain my question. I tried the "Arbitrary Mask" with usually format i know from excel like 0 "x" and # "x" but it doesnt work so Acrobat seems to have a little bit different format system.

I just want a field where the user can enter a number and after going out of field the number should get displayed with an "x" behind. When editing the field the x should not be inside the form so just visual.

 

Many Thanks

TOPICS
How to , PDF forms

Views

378

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

Enthusiast , Feb 26, 2021 Feb 26, 2021

He should have said condition of number length, but anyway I know this is old philosophy problem what is behind a number and what is in front of number but in this case I belive OP wants x after numbers and not before.

Votes

Translate

Translate
Community Expert ,
Feb 26, 2021 Feb 26, 2021

Copy link to clipboard

Copied

I don't know the length in numeric characters that you need to type in that field, so in the case that the you need a lengthy number  separated by coma you can use a custom format script in the event target field like this:

 

var f = event.target;

if (!event.willCommit) event.value = "x"+ util.printf("%,0.0f", Number(event.target.value));

 

Using this expression answers your inquiry and also  allows to use the value typed in that field with other dependent calculating fields in that form regardless of the "x" preface string value added to it.   

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
Enthusiast ,
Feb 26, 2021 Feb 26, 2021

Copy link to clipboard

Copied

He should have said condition of number length, but anyway I know this is old philosophy problem what is behind a number and what is in front of number but in this case I belive OP wants x after numbers and not before.

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 26, 2021 Feb 26, 2021

Copy link to clipboard

Copied

LATEST

Thank you Asim.

 

Then  I guess it would be like :

var f = event.target;

if (!event.willCommit) event.value = util.printf("%,0.0f", Number(event.target.value)) + "x";

 

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