6 Replies Latest reply on Feb 20, 2013 5:00 PM by jhurlbut

# Simple Division in Acrobat Field

I have a field in Acrobat that I type in the number of homes that were sold in the previous 90 days, this will always be a whole number.  I've formatted the field as a number with 0 decimal places.

I have another field that I want to just take that field and divide by 3 to give me the average number of homes sold per month for the past 3 months.  I have this field formatted as a number with 2 decimal places.

I am also getting the "The Value Entered does not match the format of the field [field name]" error which I understand is a divide by 0 error.

I would like a quickie script that solves both the error and does the simple division.  I know nothing about JavaScript.  I was just hoping in Simple Notation I could put in FIELDNAME/3 and that would work, but apparently not.

Any help would be GREATLY appreciated.  All the answers I found had calculation scripts that took into account two different field names, but nothing with a simple divide by interger.

Thanks!

John

• ###### 1. Re: Simple Division in Acrobat Field

This happens when you try to divide by zero, which is illegal. You need to

use a script that checks if the divisor is zero, and only if it's not

proceeds with the calculation.

• ###### 2. Re: Simple Division in Acrobat Field

How are you calculating this "average" field?

What is the code you entered into the calculation method?

What is the name of the field for the "Homes sold in the past 90 days"?

Since you have a constant there should not be a problem.

With a field name of "HomeSales" for the number of homes sold in the past 90 days you can use the Simplified Field Notation:

HomeSales / 3

If the field name has spaces then you need to use the "\" before the space. So if the field name is "Home Sales":

Home\ Sales / 3

• ###### 3. Re: Simple Division in Acrobat Field

Thanks guys,

The Field name that I enter the number of sales is "90Days"  No spaces.

The calculations I've tried are:

90Days/3

And

90Days / 3

I don't know if the spaces matter?

Thanks!

• ###### 4. Re: Simple Division in Acrobat Field

Field names for simplified field notation should not start with a number.

• ###### 5. Re: Simple Division in Acrobat Field

I would have never thought of that! When I get back to my Mac I'll change it and see if that works! Thanks!

• ###### 6. Re: Simple Division in Acrobat Field

OK, I renamed the field "ninetydays" and that worked dandy for that simple calculation.  Thank you so much!