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

clear contents of decimal field

Annie101
Registered: May 26 2009
Posts: 8
Answered

I have created a calculation using FormCalc. The results (decimal) field is empty in the Design view but showing as $0.00 in the PDF preview and printouts.
Can I make this field appear blank until information is entered?

My Product Information:
Acrobat Pro 8.0, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You can set the field value to the "null" value in FormCalc. Now you either need to decide to 'null' the field when zero or only when none of the possible input fields have no value using the 'HasValue()" function.

George Kaiser

jonom
Registered: Jan 31 2008
Posts: 133
If you set the Display Pattern for the calculated field to Allow Zero (or put "zero{}" in the Pattern box) it won't display a zero.

Click on the Patterns button on the Object palette when you have the field selected to get there.
Annie101
Registered: May 26 2009
Posts: 8
Entering "Allow Zero" does remove the zero, and when I enter a calculation, it shows the result, but when I tab to go to the next field, the number disappears. (although the value is included into the sum of a series of calculations). Is there a way to have the result appear, but not the zero?
I'm using Adobe pro 8. Am upgrading shortly.
Thanks!
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You can test the result of your calculation and then either enter the computed value or the "null" vlaue.

var result = Sum(DecimalField1[0], DecimalField1[1])if(result eq 0) thennull // null displayelseresult // display resultendif

Our you can place the following in the "Display Patteren":
Quote:
zero{}

George Kaiser

Annie101
Registered: May 26 2009
Posts: 8
zero{}
in Display pattern works! But I've lost the Dollar sign.
jonom
Registered: Jan 31 2008
Posts: 133
In Display Patterns you need to add the number formatting you want for the field as well - so click on the pattern you want and it should add it to the field.

The line in the Pattern box should end up looking something like this: [b]zero{}|num{$z,zzz,zz9.99}[/b] (multiple patterns are separated using the Or operator "|").