Hi @XanderBakker , I am doing something similar but using the expression in a custom attribute display, and therefore do not have the option to round the result afterwards.
The expression is as follows:
// call the sites feature layer
var sites = FeatureSetById($map, /* Sites */ "Test_site_layer_8539")
// establish spatial relationship between the two layers and return a count
var grids = Count(Intersects($feature, sites))
// round the result
var roundgrids = Round(grids, 0)
return roundgrids
The test shows the number formatted correctly, but in the popups it still shows 2 decimal places. This is how the popup is formatted: