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

How can I calculate a percentage in my form

rhino
Registered: Dec 8 2010
Posts: 5

Since there isn't a button for % in the calculation properties. I am having trouble with calculating the tax rate in my form. You can see the form here. Thanks for your time.
www.interstatecarports.net/testform.pdf

My Product Information:
Acrobat Pro 9.0, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You don't need the % symbol to calculate percentages, it's just simple math.
If you want 16% of x, just multiply x by 0.16 .

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

rhino
Registered: Dec 8 2010
Posts: 5
Thank you for your response. I did think about that, but I cant expect the dealers that are using this form to type in the tax rate like that. I need it super user friendly. If you know of any other option I could use, I would greatly appreciate it. Thanks
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You don't need to. If you have them enter 16, and then you divide it by 100 yourself, like so:

x * (taxrate / 100)

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

rhino
Registered: Dec 8 2010
Posts: 5
I want to take the "price" field and times it by the "tax rate" field to total out in the "tax" field. Do I insert that calculation script in the "tax" field properties under Custom Calculation Script. I know absolutly nothing about java script, so I do apologize if this sounds funny.

price*(tax rate/100) <---do i need to rename the fields for the script to read itThanks for your help!!!
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Almost. You need to place it as the Simple Notation calcluation of the tax field.
And yes, you need to rename the fields (or change the code so they match). Also, they can't have spaces in their names if you use this method.

PS - This is not JavaScript, it's an internal way Adobe uses to enable simple calculations. Acrobat/Reader will convert this to JS for you.

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

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
I would look at setting the format for the number and percentage fields, this can avoid of a lot of programing task like keystroke, formatting, and validation tasks. If you set a tax rate as a percentage, then you only need to multiply by the value of the percentage field. The formatting adjust the decimal place and "%" symbol display and displays say 0.10 as 10%. This is similar to how Excel works. By having the fields properly formatted for the type of data they represent allows you to simply use the values within a computation and you do not need to make special adjustments. See CarPortOrder.pdf with some of the suggestions applied.

George Kaiser