AnsweredAssumed Answered

Arcade's Round function giving inconsistent results in AGOL pop-up

Question asked by aroust on Apr 13, 2020

I've pulled the Unacast web service into an AGOL web map for our coronavirus site. For part of the display in my pop-up, I have this custom Arcade expression to convert the values in the difference field to a positive number and then display the percentages with a max of two decimals:

 

var travelpercent = Abs($feature["daily_distance_diff"])
return (round(travelpercent, 2)*100) + '%'

However, the results in my pop-ups are inconsistent. In one spot, it looks great:

But in another, it looks like this:

 

I've been ignoring it so far, but Douglas County is my county and that percentage looks ridiculous. Are there any tweaks I can make to the Arcade code to fix this?

 

Edited to add: I tried changing the rounding to 1 decimal place and it rounded our county up to 60%. Then I tried 0 and it rounded to 100%!! Oh my.

Outcomes