thousands separators in Arcade

105
3
Jump to solution
2 weeks ago
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 Regular 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

3 Replies
jcarlson
MVP Regular 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 Regular 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