Assuming latitude2 is required, the following result was found.
(unit=="N") { dist = dist * 0.8684 } // nautical Production code // v_Latitude1, v_Longitude1 are coords for origin // v_Latitude2, v_Longitude2 are coords for destination v_Latitude1 = v_Latitude1.toDecimal(); v_Longitude1 = v_Longitude1.toDecimal();...