Select to view content in your preferred language

Arcade function "distance" gives values below zeros

722
3
04-03-2023 05:14 AM
Labels (3)
HalaAbdelmaksoud
Frequent Contributor

Hi all, 

I face an issue with Arcade in "Calculate Field"

I was trying to calculate the distance between two features, but it gives me numbers like: 3.06370662743992E-03, 2.1836948170503E-04, .... as in image(1) 

after applying Floor (value, 4) it gives numbers like:0.0228, 0.003, .... as in image(2)

I want to have the distances in meters, and I am sure that all the distances are more than zero.

1.png

2.png

Tags (2)
0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

Are you using a projected coordinate system?


... sort of retired...
KenBuja
MVP Esteemed Contributor

Numbers like 3.06370662743992E-03 are not below zero. They are in scientific notation, which is equivalent to 0.00306370662743992.

If you'd like to make sure you don't get numbers like that, you can use the Text function to return numbers at a set number of decimal places.

0 Kudos
DavidPike
MVP Frequent Contributor
var dist = DistanceGeodetic($feature, w_point, 'meters')