2 Replies Latest reply on Feb 24, 2017 9:09 AM by gkaiseril

# Simple tax equation

Hello there,

I am trying to do a simple equation that I can not seem to figure out. I have a subtotal amount and discount that is being given. For the total amount I would like it to give me the price amount with the tax being included for a new total. I would think this formula would be work. I could be wrong.

Total = subtotal1-(Subtotal1*discount)

or

subtotal1-(Subtotal1*discount)

when i did the an easy equation it does not change the numbers as well. I also fixed the calculation order.

• ###### 1. Re: Simple tax equation

I'm pretty sure that case is significant. What that means is that subtotal (lower case s) and Subtotal (upper case S) are different things. So take care to match the formula and the design together.

• ###### 2. Re: Simple tax equation

I had all the caps the same. I did a quick outline of the issue. Unfortunately that was not the issue.

• ###### 3. Re: Simple tax equation

What calculation do you use now?

• ###### 4. Re: Simple tax equation

God question. Please copy abd paste or screenshot the current calculation. I took the screenshot as being from the actual file before, mistake and all.

• ###### 5. Re: Simple tax equation

[Question moved to the JavaScript forum]

• ###### 6. Re: Simple tax equation

Upper/lower-case is critical. You must enter the fields names EXACTLY (well, except for spaces that need to be escaped) as they actually are.

• ###### 7. Re: Simple tax equation

All calculations are case sensitive.

Did you get any error pop-ups when you entered your code?

Did you check the Acrobat JavaScript console for any execution errors?

When I use your code and then open the Acrobat JavaScript console, I get the following error:

TypeError: getField(...) is null

2:Field:Calculate

Simplified Field notation is just a simple front end to a JavaScript function that performs the same code that a custom calculation script could use.

JavaScript is very case sensitive and you must have the same capitalization used for the field's name. Spaces in field names and object names require special handling.