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

Using a space rather than comma in thousands

Community Beginner ,
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

567

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

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 ,
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?

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 ,
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, ',');

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