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

Automatic Calculation calculates the input value instead of the rounded up value

New Here ,
Aug 16, 2022 Aug 16, 2022

Hello.

 

I am trying to create a form with the automatic calculation. I have set the format as Number and 2 decimal places. But if I input the value as 13.004, although it will display it as 13.00, the true value would remain as 13.004. Then when I try to total the value, it would go off as it is not using the rounded off value(2 decimal place). It would use the input value rather then the displayed value. 

 

How do I make it round off to two decimal places and use that rounded off value? 

 

 

TOPICS
How to , PDF forms
388
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 ,
Aug 16, 2022 Aug 16, 2022

That's because the Format option doesn't change the field's actual value, only the way it is displayed.

To do that you have to you a script. For example, as the field's custom Validation script enter the following code:

if (event.value) event.value = 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
New Here ,
Aug 17, 2022 Aug 17, 2022
LATEST

Hello, thank you for your quick response.

I am still unable to convert the following numbers to 2 decimals place. As you can see in the photo, for the 1.00, I input the value as 1.003. For the 0.00, I input the value as 0.003. Hence that will mess up the total. How do I solve this issue? I am not using any custom script at the moment. I am using the Format and Calculate properties.

Justin25667601gtaj_0-1660723578523.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