Decimal Places in AGOL

237
1
03-15-2024 02:28 AM
Paul_Duffy_Waters_of_LIFE
New Contributor II

Hi,

I know I am not the first person to raise this question...

I have a numeric field in ArcGIS Pro that contains a mixture of whole numbers and decimals (up to four decimal places), i.e. 30, 15.7, 0.59 etc. I need the values to be numeric as I need to add them to a dashboard and perform calculations.

When I publish to AGOL I run into the same issue that others have identified, with the field I now need to set a number of decimal places..

If I set it to four decimal places I get 30.0000, 15.700, 0.5900

If I set it to Zero Decimal places I get 30, 16, 1

The workaround I have found is to create duplicate field in Pro as text, and copy the values in there. I then use this as the display field in AGOL, but its a bit of a pain..

Does anyone know if there is a better solution for this? Or is there way of adding AGOL honouring values as imported from Pro as an idea?

Thanks,

Paul

 

 

 

Tags (2)
1 Reply
MobiusSnake
MVP

For display purposes (like a label or in a pop-up) you could use the Text function of Arcade, it allows you specify a fixed number of places:

https://developers.arcgis.com/arcade/function-reference/text_functions/#text

A simple example would be something like this as a label function:

Text($feature.SHAPE__Area, "#.000")