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

Why are my calculated values not formatting correctly

Community Beginner ,
Jan 31, 2024 Jan 31, 2024

Can anyone tell me why my values are coming out as standard decimal notation?

There is nothing special going on here just Footage*price = total.  Some of my values come out correctly $ amount with 2 decimals and others are like this example 128.3500000000002.  Does anyone know how to correct the formating?  Also this is only happening with certain calculations.  

5 x $25.67 = 128.35000000000002

6 x $25.67 = 154.02

 

Attached is also the file I am working on.

properties.JPGexpand imageTotal Fence value.JPGexpand image

TOPICS
PDF forms
2.4K
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
2 ACCEPTED SOLUTIONS
Community Expert ,
Jan 31, 2024 Jan 31, 2024

On mobile devices it is not guaranty to work even in PDF expert.

For me on Acrobat pro works fine, you can use custom calculation script instead and set number of decimals with toFixed() method.

You can also remove all simplified field notations and use loop to calculate all fields with one script (although your field "Total FenceAMTRow25" has an error in naming, there shouldn't be space if you are going to use loop).

 

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
Community Expert ,
Feb 02, 2024 Feb 02, 2024

You need to fix field calculation order, your TOTALS OF JOBS should calculate last, and it's on the top of the list (should be on the bottom).

If you are still using old adobe interface, select 'Prepare form' tool then click on 'More' and 'Set field calculation order', make sure fields that calculate first are on top.

EDIT:

I would remove all of those calculations and use loop in one field to calculate all like this:

https://drive.google.com/file/d/1hvey9Z8GWJfB9MVn_BH1bbny2uIjx6jk/view?usp=sharing 

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
Community Expert ,
Jan 31, 2024 Jan 31, 2024

Where do you use file?

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 Beginner ,
Jan 31, 2024 Jan 31, 2024

Our sales reps use it in PDF Expert and flatten the file.  Flattened it shows all the decimals. We need it not to.

My example is in Adobe Acrobat Pro.

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 ,
Jan 31, 2024 Jan 31, 2024

On mobile devices it is not guaranty to work even in PDF expert.

For me on Acrobat pro works fine, you can use custom calculation script instead and set number of decimals with toFixed() method.

You can also remove all simplified field notations and use loop to calculate all fields with one script (although your field "Total FenceAMTRow25" has an error in naming, there shouldn't be space if you are going to use loop).

 

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 Beginner ,
Feb 01, 2024 Feb 01, 2024

Thanks Nesa, I was able to add the toFixed() script and got it working.  I appeciate your help.

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 Beginner ,
Feb 02, 2024 Feb 02, 2024

File attached has the script active but the Totals of Job does not seem to be calculating correctly.  Could you take a quick look and see if you notice what the issue is?

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 ,
Feb 02, 2024 Feb 02, 2024

You need to fix field calculation order, your TOTALS OF JOBS should calculate last, and it's on the top of the list (should be on the bottom).

If you are still using old adobe interface, select 'Prepare form' tool then click on 'More' and 'Set field calculation order', make sure fields that calculate first are on top.

EDIT:

I would remove all of those calculations and use loop in one field to calculate all like this:

https://drive.google.com/file/d/1hvey9Z8GWJfB9MVn_BH1bbny2uIjx6jk/view?usp=sharing 

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 Beginner ,
Feb 02, 2024 Feb 02, 2024
LATEST

Thank you soooo much. I think I'm all good now.  

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 ,
Jan 31, 2024 Jan 31, 2024

PDF Expert is not reliable, it's a low-end software based on MacOS PDF Services.


Acrobate du PDF, InDesigner et Photoshoptographe
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 Beginner ,
Feb 01, 2024 Feb 01, 2024

Also does anyone know why this would have started happening just now?  We've used these forms for years and just this past week started to see this issue.

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 ,
Feb 01, 2024 Feb 01, 2024

Does this issue occur before or after flattening?


Acrobate du PDF, InDesigner et Photoshoptographe
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 Beginner ,
Feb 01, 2024 Feb 01, 2024

Before but you can only see the decimal values if you click on the field.  Flattening just shows the whole value.correct value.JPGexpand imagebut with decimal.JPGexpand image

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