Expand my Community achievements bar.

Percentage Issues

Avatar

Level 4

Hi,  I continue to have problems with percentages.  How can I format a number field so that it writes a percent like 5.5 as 5.5%.   I've tried different methods and it goes all over the place.  Any assistance would be greatly appreciated.

Connie

3 Replies

Avatar

Level 10

Hi,

simply use the display pattern num{zz9.9 '%'}

Avatar

Level 4

I tried what you suggested in your message above, but it still comes out wrong.  5 x 1.0% should equal to 0.050 and it comes out as 5.  Can anyone help?

Thanks

Connie

Avatar

Level 10

Hi,

did you write the % within the quotes?

If not the pattern works differently. The percentage pattern only returns integers.

But when you use quotes, then the % character is just a string attached to the formatted value.

Examples:

Pattern                         Entered Value            Displayed Value

num{z,zzz,zz9%}         1                                   100%

num{z,zzz,zz9%}         5.5                                550%

num{z,zzz,zz9%}         0.5                                50%

num{z,zzz,zz9%}         0.25                              25%

num{z,zzz,zz9.88'%'}  1                                   1%

num{z,zzz,zz9.88'%'}  5.5                                5,5%

num{z,zzz,zz9.88'%'}  87                                 87%