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

display % sign

ark_1717
Registered: Apr 22 2008
Posts: 14

I have the following form calc calculation set up to calculate percent of:

if (TotalCurrent <> 0)

then
SmallActualCurrentPerc=(SmallActual / TotalCurrent) * 100
else
0
endif

I have the display pattern and edit pattern set to z9.9% but when the calculation is performed the % does not display. How do I fix this.
Thanks!

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The % symbol is a special character in the "Picture Clause", that's what the display pattern is called and there is a reference document for it somewhere on the Adobe web site. To use this symbol you have to specify the unicode character code. for it. The Picture Clause below not only displays the % symbol, it also moves the decimal point, so the real field value could be "0.25", but it would display as "25%"

num(en){szzzzzzzzzzzzzzzzvz9'.'9z'\u0025'}

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

ark_1717
Registered: Apr 22 2008
Posts: 14
Thanks, but what if I didn't want to move the decimal point. For instance if 25 was typed instead of 0.25?

I looked up the reference but I could not find any information about the % sign.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can put the % into your original picture clause

num(en){sz9.9'\u0025'}

I could be wrong about % being a special character. It's been a while since I looked over the picture clause info. But when I originally developed the % picture clause in the previous post I used the unicode character code instead of just using %. I thought I did it because there was an issue with using the character directly, but I could have just been being fancy.

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

Formfingers
Registered: Feb 7 2007
Posts: 90
I have found the below pattern to display my percentage and numbers just as typed:

num(en){zz9'\u0025'}

So, if you enter "20" in the field, it will display "20%" without decimals or extra digits.

Hope this helps!