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

Calculation Format Error

combsg
Registered: Apr 25 2007
Posts: 4

I wanted to know how to custom script this equation.
 
((C/D)*E)/F
 
I am needing to let D or F be equal to zero at the beginning and not do a format error sign. Eventually D and F will have values, but you have to enter several things in C before you can get to D and it keeps popping up with formatting error sign.
 
Thanks.

My Product Information:
Acrobat Pro 6.0.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
This seems to be a very popular issue. I've been playing around with calculations on LiveCycle forms and Acrobat is very forgiving about bad calculations and formatting. But there are times when it needs to be spot on.

To do this the calculation script needs to test for zero values before the actual calculation takes place. This should guarentee compliance with the field formatting

if((D.rawValue == 0) || (F.rawValue==0))this.rawValue = null;else... do calc ...

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script