+ if (lon < 0) {
+ lon_sign = 'W';
+ lon = -lon;
+ }
+
+ /* Round latitude and longitude by 0.005 minutes */
+ lat = lat + 833;
+ if (lat > 900000000)
+ lat = 900000000;
+ lon = lon + 833;
+ if (lon > 1800000000)
+ lon = 1800000000;
+
+ lat_deg = lat / 10000000;
+ lat -= lat_deg * 10000000;
+ lat *= 60;
+ lat_min = lat / 10000000;
+ lat -= lat_min * 10000000;
+ lat_frac = lat / 100000;
+
+ lon_deg = lon / 10000000;
+ lon -= lon_deg * 10000000;
+ lon *= 60;
+ lon_min = lon / 10000000;
+ lon -= lon_min * 10000000;
+ lon_frac = lon / 100000;
+
+ /* Convert from meters to feet */
+ alt = (alt * 328 + 50) / 100;
+
+ buf += sprintf((char *) tncBuffer, "!%02u%02u.%02u%c/%03u%02u.%02u%c'/A=%06lu ",
+ lat_deg, lat_min, lat_frac, lat_sign,
+ lon_deg, lon_min, lon_frac, lon_sign,
+ (long) alt);
+ break;
+ }
+ }