Pythagoras theorem, so not taking into account curvature of the earth or anything like that. This has been tested for likely distances we'll see in the system and is still highly accurate
Rounding the distances to whole miles if > 5 miles away, or to 1 decimal place if < 5 miles away
We can calculate this in a number of ways, see:
http://www.movable-type.co.uk/scripts/latlong.html
Probably for the distances involved it will be sufficient to use pythagoras