# Percentage and Sub Total Calculations

Community Beginner ,
Mar 10, 2021 Mar 10, 2021

Copied

Hi,

I need to create a calculation so that whatever is entered into the 'percentage uplift' box gets added to the 'subtotal own stock' and gives me a total. Do I need a javascript to do this? Should I keep the percentage uplift field a percentage or a number?

Hope you can help

Thanks

TOPICS
PDF forms

Views

196

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Adobe Community Professional , Mar 12, 2021 Mar 12, 2021
++Adding to the discussion,   I see that you have all the text field object names starting with a number.   I've read in other threads in this community that when you use simplified notation or the built-in "SUM" feature to calculate field values it may throw errors.   What I would do in this caseis to follow the same guidance that George Johnson already gave you but change the field names. In particular just eliminate the "5" that is preceding every field name in your PDF and see if that resolv...

Likes

7 Replies 7
Mar 10, 2021 Mar 10, 2021

Copied

You don't need to use JavaScript necessarily, unless you have specific rounding requirements. You could use the simplified field notation option when setting up a calculated field, and it would probably be best to set it to a number and configure the calculation correctly. For example, in the Totals field, the what you'd enter could be:

5OwnStockSubTotal * (1 + 5PercentageUplift / 100)

Assuming that's the correct formula.

Likes

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 Beginner ,
Mar 11, 2021 Mar 11, 2021

Copied

Thnak you I think that has worked.

Likes

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 Beginner ,
Mar 11, 2021 Mar 11, 2021

Copied

Ah, I have tested it again and it does not work for some reason.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 11, 2021 Mar 11, 2021

Copied

If it appears to have worked at times but not others, it could be a problem with the field calculation order. If you're unaware of how to set it correctly, post again and include the version of Acrobat that you're using. Also, include more details about how it's not working.

Likes

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 Beginner ,
Mar 12, 2021 Mar 12, 2021

Copied

Hi there, I originally put your calculation in the 'Plus percentage uplift' box, not the totals field. The calculation adds the number and not a percentage.

I need the left totals field to calculate the 'Sub total Own Stock' + 'Plus a percentage uplift' and the right totals field to calculate the figures on the right. The trouble I am having is, what calculation do I put in the 'Plus a percentage uplift' box to add what ever percentage they enter to te 'Sub total - own stock' to give a figure for 'Totals' box on the left.

The other issue I am having is that as you can see by the screen shot my calculation for the 'Grand Total Amount Insured' is not picking up the percentage uplift field.  When I add it into the calculation it adds the amount to both totals, not just the one on the left.

I am using the latest Acrobat Pro DC software.

Many thanks

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 12, 2021 Mar 12, 2021

Copied

I see that you have all the text field object names starting with a number.

I've read in other threads in this community that when you use simplified notation or the built-in "SUM" feature to calculate field values it may throw errors.

What I would do in this caseis to follow the same guidance that George Johnson already gave you but change the field names. In particular just eliminate the "5" that is preceding every field name in your PDF and see if that resolves the issue.

Likes

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 Beginner ,
Mar 12, 2021 Mar 12, 2021

Copied

Thank you very much. That has made it work now.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources