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

Suppressing 0% showing within field

mR_Jones
Registered: Jul 6 2009
Posts: 25

Hello,
I've created a field using a custom script, however I'd like to suppress the 0% which is showing within the field. The field has been set to a format of Percentage. "0" decimal places and a separator style of "1,234.56".

Here is the script I'm using which was provided via a prior post:

var quotient = "";
var divisor = this.getField('LTVValue1.0').value;
if( divisor != 0) {
var dividend = this.getField('OLA1.0').value;
quotient = dividend / divisor ;
}
event.value = quotient;

If anyone could provide any type of direction, that would be greatly appreciated.

Thanks -

My Product Information:
Acrobat Pro 9.3.1, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Change the last line of the code to this:
if (quotient!=0) {event.value = quotient;} else event.value = "";

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

mR_Jones
Registered: Jul 6 2009
Posts: 25
Thanks try67 however this script seems to make no difference. The field is still displaying a 0%.
The script you provided is to replace: event.value = quotient; correct?
Does this require a adjustment to the format tab?
Please enlighten me!
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You can not suppress formatted numeric strings that include symbols like the percentage sign or a monetary symbol. But you can hide the field.

George Kaiser

mR_Jones
Registered: Jul 6 2009
Posts: 25
Hello gkaiseril ,

So, what you are saying is. There is no method..period?
If I hide the field, that will not help in coming to a conclusion from the users standpoint.
Well, if there is no solution; then it is what it is :-/
Thanks for the input, greatly appreciated.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
What are you trying to accomplish?

If you want the field to show only the percentage, then hide the field for computation if the calculation result is zero and display a text field with just the percentage symbol. If you have a non-zero answer, then display the calculation field and hide the text field.

George Kaiser

mR_Jones
Registered: Jul 6 2009
Posts: 25
Hello gkaiseril ,
What I'm trying to accomplish is getting a end result which has a percent sign.
The field in which I want to populate must have a percent sign and number but only if the beginning portion of the calculation is acknowledged. If the beginning portion is not acknowledged then leave blank.

Thanks -