thousands separators in Arcade

4121
4
Jump to solution
06-07-2021 08:41 AM
steffen4arcgis
New Contributor

Hi,

I'm looking for thousands separators in Arcade to use in ArcGIS Dashboard advanced formatting option. Which code should be used? Nothing found about.

Greats,

S.Peter

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

You'd need it to read

middleText: Text($datapoint.numbers, '###,###')

 Personally, I prefer to do any manipulation of objects and variables outside of the return statement. That way if something's not working, you can try to debug it easier. I tested this in an indicator, and it does seem to be working. I'd double-check your expression.

var some_int = 123456;

var mtext = Text(some_int, '###,###');

return {
    middleText: mtext
  }

jcarlson_0-1623158957651.png

 

- Josh Carlson
Kendall County GIS

View solution in original post

4 Replies
jcarlson
MVP Esteemed Contributor

Try Text, maybe?

Text(123456, '###,###') -> 123,456
- Josh Carlson
Kendall County GIS
0 Kudos
steffen4arcgis
New Contributor

It doesn't work. Does the number have to be formatted as text? I use the expression in ArcGIS Dashboard Indicator. --> middleText: ($datapoint.numbers, '###.###'),

numbers = integer

separator = "."

0 Kudos
jcarlson
MVP Esteemed Contributor

You'd need it to read

middleText: Text($datapoint.numbers, '###,###')

 Personally, I prefer to do any manipulation of objects and variables outside of the return statement. That way if something's not working, you can try to debug it easier. I tested this in an indicator, and it does seem to be working. I'd double-check your expression.

var some_int = 123456;

var mtext = Text(some_int, '###,###');

return {
    middleText: mtext
  }

jcarlson_0-1623158957651.png

 

- Josh Carlson
Kendall County GIS
Ade_Bruijn
New Contributor III

For the users who prefer the .(period) as separator. Arcade needs , (comma) and (if I'm not mistaken) your organisation settings return a .(period)

0 Kudos