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

limit number decimals

New Here ,
Oct 05, 2020 Oct 05, 2020

Hi, 

sorry for my English.

I would like to know if it is posible, in a form, if can be limited the numbers of decimals.

For expamle, if the user insert : 2,25, he cant insert more decimals, becuase the limit is 2.

 

Thanks!!! 

TOPICS
PDF forms
1.5K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Oct 05, 2020 Oct 05, 2020

The Format setting only determines how the value of the field is displayed, not its actual value.

In order to do that you can use the following code as the field's custom Calculation or Validation script:

if (event.value) event.value = Number(event.value).toFixed(2);

View solution in original post

Translate
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 ,
Oct 05, 2020 Oct 05, 2020

i am usisng thius:

default4ubmk8dg2ro0_0-1601883926052.png

but the proble is, visually is correct, but really if user insert 3 decimals its allow:

Visually:

 

1.JPG

 

But in really, the form send:

2.JPG

 

This is a problem for me....

Thanks

 

Translate
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 ,
Oct 05, 2020 Oct 05, 2020

The Format setting only determines how the value of the field is displayed, not its actual value.

In order to do that you can use the following code as the field's custom Calculation or Validation script:

if (event.value) event.value = Number(event.value).toFixed(2);

Translate
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 ,
Oct 05, 2020 Oct 05, 2020

set limit number of characters

tempsnip.png

Translate
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 ,
Oct 05, 2020 Oct 05, 2020

That's not a good solution. What if the number should be 123.456,56 ?

Translate
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 ,
Oct 05, 2020 Oct 05, 2020

Yes ,sry I read something else, thought he want to limit number input.

Translate
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 ,
Jan 08, 2022 Jan 08, 2022
LATEST

Is there any way i can use custom number seperator for calculated field 

Usually numebr formats have seperator 9,999,999.00

& i want to change it to 9,99,99,999.00

Do i need to use javascript or is there any other way to do get required numeric display pattern

Translate
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