Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Using a space rather than comma in thousands

New Here ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

Hello! I am building a form where I have a few number fields where users will input the numbers and then they will be calculated. But, I want to show the numbers like this: 23 444 rather than this: 23,444.

 

I have tried some script that I found, but can't get it to work. Does anyone have a solution for this? I need both the inputted numbers and the final calculation to be displayed like this.

 

Thanks.

TOPICS
PDF forms

Views

65

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
Engaged ,
Jul 30, 2021 Jul 30, 2021

Copy link to clipboard

Copied

@kathleenm90423663   Yes, it possible please check the link below and let me know if this what you want:

https://www.dropbox.com/s/snfx5kh6fp34oi3/space.avi?dl=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 ,
Aug 03, 2021 Aug 03, 2021

Copy link to clipboard

Copied

I don't understand at all how this video shows me how to solve my problem. All it shows is putting spaces in a number. Am I missing something?

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 ,
Aug 12, 2021 Aug 12, 2021

Copy link to clipboard

Copied

LATEST

In case anyone else is looking for an answer to this, here is what worked for me. I added this to custom format script. This gets rid of 2 decimal places, and replaces the comma with a space.

 

For inputted fields:

event.value = event.value.replace(",", "."); var x = Number(event.value).toFixed(0);
event.value = x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ").replace(/\./g, ',');

 

For calculated fields:

var x = Number(event.value).toFixed(0); event.value =
event.value = x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ").replace(/\./g, ',');

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