Select to view content in your preferred language

How do you get a percentage sign to show in your data (for use in popups and such)?

7048
7
Jump to solution
11-03-2017 05:41 AM
KessaTurnbull
Occasional Contributor

Can only figure out how to do it by converting into a string which defeats the purpose since then you can't do any quantitative analysis on it. 

1 Solution

Accepted Solutions
CorineRamos
Emerging Contributor

Hey Kessa, I think you can do something like this:

After clicking "configure popup" for the layer you want to show percentages, you can click ADD under Attribute Expressions. Then just choose the field you want to show with the percentages by clicking it once. This should add it to the script box. Then on the same line you can enter this:   + "%"   

When I did it to test, it looked like this: 

It worked for me so I'm thinking this should do the trick for you.(This was after I clicked test to see if it worked)

View solution in original post

7 Replies
CorineRamos
Emerging Contributor

Hey Kessa, I think you can do something like this:

After clicking "configure popup" for the layer you want to show percentages, you can click ADD under Attribute Expressions. Then just choose the field you want to show with the percentages by clicking it once. This should add it to the script box. Then on the same line you can enter this:   + "%"   

When I did it to test, it looked like this: 

It worked for me so I'm thinking this should do the trick for you.(This was after I clicked test to see if it worked)

Lake_Worth_BeachAdmin
Frequent Contributor

this is why Arcade expressions so awesome! 

ElijahAllan1
Emerging Contributor

What if you wanted only a certain number of significant values, for example I want  55.00000000000001%  to just be 55.00% , is there an expression to do that?

0 Kudos
AgnesCikowska-Teczar
New Contributor

To adjust how many numbers display after the period, go to Configure Pop-Up --> Configure Attributes --> Click on the Attribute you want and a format box should show on the right where you have the ability to adjust how many numbers display after the period.  

MelissaMitchell
Occasional Contributor

Hello,

How did you get your number 5.55555555% down to 5.55%? I'm having the same problem in the popup.

thank you!

0 Kudos
ConorFlannigan
New Contributor

This thread is a little old at this point, but you can use the built-in "round" function. The "Configure Attributes" solution won't work since we're working with strings/text.

ConorFlannigan_0-1618014239482.png

Unfortunately, you cannot sort a table with this column, so there's a bit of a trade-off.

0 Kudos
MelissaMitchell
Occasional Contributor

I have a decimal number (.11) in a table and want to convert it to a percentage. In arcade I did something like this

($feature.field*100) + "%"

 which worked for quite a few numbers except for .11 which turns into this 11.110000000000001%. How do make sure it stays to two decimals? I've tried change the decimal like the image above but it didn't work.

thank you!

0 Kudos