Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

FormCalc Question for LiveCycle Designer in Acrobat 8.0

Avatar

Not applicable
Hi,



I can't figure out how to write a calculation in FormCalc so that n (the number entered into the form field) multiplied by .485 equals X. This calculation is so that someone filling out the form can enter the number of miles driven and the form automatically converts the miles to the dollar amount based on the IRS mileage reimbursement. So n=some number multiplied by .485. I have tried:



n * .0485

n*.485

fieldnam * .485



and various permutations setting the parameters to "calculate" and "FormCalc". The field is currently a decimal field, and I've tried it as numeric with no luck.



Any ideas? This is, of course, one in a series of calculations for a reimbursement form. And, as you can tell, I am a newbie. I've made plenty of forms, just none that do math.



Thanks,

Catherine
7 Replies

Avatar

Not applicable
You are very close. Make sure your FormCalc Calculation event is set to run on the field that will display the reimbursement value.



MilesDrivenFieldName * .485



Carl Young

http://www.pdfconference.com

Avatar

Not applicable
Hi,



Thanks. Actually, after pondering this I realized I was going about it all wrong. The calculation was the first in a series of three calculations. The sedond summed this field, plus two others. So, since the sum worked I wrote:



sum ((fieldname1 * .485), fieldname2, fieldname3)



That did the trick. I also changed the fieldname1 to be a numeric field instead of a decimal field. It works and all is right in the world.



Thanks and I'm sure that your suggestion works as well - I'll go test it out.



-Catherine

Avatar

Not applicable
hi,



i want to know if i can use a calculation function to text, for example for the days of the week, using the function "if" or another. please see the next:



if d1 = sunday then d2 = monday elseif d1 = monday then d2 = tuesday ...



but i can't use that, is there something function to calculated this item?



my name is arnoldo. my e-mail is ram1204@hotmail.com



Thanks

Avatar

Not applicable
I'd like to follow up to Catherine's original question. I too, am putting together a form that needs to have certain fields calculate a mileage reimbursement rate (miles x .485).

I have each of my numeric fields named "AutoMilesDriven" and set to FormCalc, which reads:



AutoMilesDriven * 0.485



Have also tried the tips/scripts above, but it still doesn't calculate as I need. In PDF Preview, each of the fields show $0.00 until you click in them and add your mileage (at which time the dollar value disappears but displays a "0" in that field). I am able to place my miles inside but when the calculation finishes, it seems to have only calculated against that zero amount (not against the $.485 amount). So, 23 miles turns into $23.00.



What step am I missing?

Avatar

Not applicable
I am not sure if you are still looking for help or not but this is how to do it.



you need three fields



1 Miles driven

2 IRS mileage reimbursement

3 Total Amount owed



name Miles driven "a" in binding tab under the object pallette

name IRS "b" in binding tab under the object pallette

and for the Total Amount Owed you enter a * b in the scripting tab under the calculate option.



If anyone would like me to send them an example let me know your e-mail and I can send you the simple one I have set up.



Aaron

Avatar

Not applicable
Im trying to duplicate a calculation program from an xl spread sheet. After user input of variables and an initial calculation, I need to reference a specific set of data from a drop down list (possibly 15 sets) depending on the initial results. This new data then can can be used to perform further calculations and can be user altered to fine tune the calculations.

1. Is there a way to set up a drop down list and based upon which item is selected from the list, populate a number of objects into a new set of cells?

2. Is there a way to selectively make FormCalc perform the calculations based upon new user input? A recalc button?

3. Is there a way to reset only part of the form in order to evaluate another set of citeria without having to re-enter the heading information?

Avatar

Not applicable
I have LiveCycle Designer 7, I'm using a drop down box, I would like to make the button smaller but not the box. Is that possible to do.