These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Calculate VAT of 17.5% - Help

pbar
Registered: Sep 14 2010
Posts: 5
Answered

Hi - I'm very new to form creation and this forum so apologies if this question is elsewhere.

I've been jumping in and out of discussions trying to take suggested code to questions regarding similar topics and just tweaking the code to suit my field names.

I have the following fields

Quantity / Product / Unit Price / Discount / Price

Below these on my form I have

SubTotal / VAT / Total

Currently I have set the PDF form set up to accurately calculate a sub total. This is using the presets from Properties > Calculate.

I cannot for the life of me work how to make my 'SubTotal / VAT / Total' fields work together.

As it stands I have The Sub Total and the Total displaying a calculation (the Total field currently is set to add together the Sub Total and VAT - as I do not know how to make the VAT "work" if you like the Sub Total and Total fields are displaying the same figure.

Please, please help - I just can't figure this out.

I'm using Acrobat Pro 9 (CS4) on a Mac

pbar
Registered: Sep 14 2010
Posts: 5
Update - I've just worked out how to calculate the percentage but I still cannot calculate the point five of 17.5. it can only use whole numbers i.e. 17 or 18.

Code I am using is...

event.value = 0.17 * this.getField("SubTotal").value;

Any clues as to how I can include the .5?
pbar
Registered: Sep 14 2010
Posts: 5
Update - Update - I've now worked it out fully. No help needed thank you. Obviously wouldn't have come close to working this out on my own without this forum.
pbar
Registered: Sep 14 2010
Posts: 5
To calculate UK VAT 17.5% from its percentage value into a cash value enter this code into
"Properties > Calculate > Custom Calculation Script"event.value = 0.175 * this.getField("SubTotal").value;

make sure to name the bracketed field ("SubTotal") with your own field name that you want the percentage to be worked out from.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You can even use the Simple Notation script. Just enter:
SubTotal * 0.175

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

pbar
Registered: Sep 14 2010
Posts: 5
Awesome - thanks for this - I've replaced with your script. :)