Expand my Community achievements bar.

Percent symbol not displaying

Avatar

Former Community Member
I have a numeric field which should display the number entered as a percentage (e.g., 5 as 5.00%, 15.5 as 15.5%).



I have set the display pattern to z9.99% however it only works when a zero is entered. Any other number and the percent sign is not displayed.



Am I missing something?
5 Replies

Avatar

Former Community Member
It will work if you enter the percentage as a decimal, i.e.:



.123 = 12.30%



Your best bet might be to put an app.alert in the enter event to pop up a message telling the user how to properly input the value, like:



app.alert("Enter the percentage as a decimal; .123 = 12.30%");



Regards,

Dave

Avatar

Former Community Member
Ah! So it is a "real" percent; it translates a decimal number to percent. I thought it would just append a percent symbol onto whatever number was entered.



I suppose if I wanted the latter (just adding a percent symbol onto a numeric entry), I would have to use script, right?

Avatar

Former Community Member
To the best of my knowledge, yes you would. I looked this up in the LiveCycle Designer help, it's not a feature I'm familiar with. I found it by searching the help index for numeric, double clicking "about" and then clicking on the Numeric patterns link in the right hand pane.

Avatar

Level 6
In the display pattern, put the % in single quotations. So,



ZZ9.99'%'



Another option, in case you hadn't considered it, is to put a static text object to the right of your right-justified numeric field and put a % there. This simple approach makes it clear to the user what you're expecting. I like to do the same with dollar amounts (i.e. put a static $ to the left of the field).



Hope this helps.



Jared Langdon

http://www.jlangdon.ca