I want to place an "up arrow" or a " down arrow" before a dollar amount signifying that the price has either increased or decreased. Any suggestions on how to format this in the Label Expression builder in arcgis for desktop? Thanks
Solved! Go to Solution.
This will add an up arrow:
...although it may be better to use the 'Advanced' option to add a more complex code block to choose the correct sign:
def FindLabel ( [NAMEPROPER], [Difference] ): if [Difference] > 0: sign = u'\u2191' # up arrow elif [Difference] < 0: sign = u'\u2193' # down arrow else: sign = '-' # no change return [NAMEPROPER] + '\n' + sign + [Difference]
In python 2.x have fun with this link Arrow symbol - Sets - Unicode® character table
>>> a = u'\u2191'
>>> print(a)
↑
>>> print(a+"$")
↑$
EDIT
Found a more elaborate link covering all kinds of arrows
I suppose it depends somewhat on your choice of font, but you can also copy/paste from the good, old Character Map. And, it's no coincidence that the code at the bottom is the same as in Dan's example.
I am all excited about the new ones coming soon... face palm is going to be popular Emoji Recently Added
Dan,
Let me start by saying I have no python language experience so please forgive my naivety. I attempted to incorporate the code you provided to what I have already done. I failed in making it work to say the least. If you could provide the proper expression that would be great. I will then return to try understanding whats going on in the code
Thanks
Ok... first, I gave an example for emulation, so.. you don't need the a = part, nor the print(a) part and you seem to have square brackets around the field names... did you switch to the python parser before or after you select the field names (aka nameproper and difference) since I don't do maps, I am only familiar with the field calculator syntax which is field names enclose in exclamation marks. so the only part you should actually type is the u'\u2191' bit and everything else you should select. Anyone that labels or does maps can leap in at anytime
This will add an up arrow:
...although it may be better to use the 'Advanced' option to add a more complex code block to choose the correct sign:
def FindLabel ( [NAMEPROPER], [Difference] ): if [Difference] > 0: sign = u'\u2191' # up arrow elif [Difference] < 0: sign = u'\u2193' # down arrow else: sign = '-' # no change return [NAMEPROPER] + '\n' + sign + [Difference]
Appreciate it! Exactly what I wanted.