diff --git a/public_html/formatter.js b/public_html/formatter.js index 8d6dca9..d25460b 100644 --- a/public_html/formatter.js +++ b/public_html/formatter.js @@ -6,7 +6,7 @@ var DEGREES='\u00b0' var UP_TRIANGLE='\u25b2'; // U+25B2 BLACK UP-POINTING TRIANGLE var DOWN_TRIANGLE='\u25bc'; // U+25BC BLACK DOWN-POINTING TRIANGLE -var TrackDirections = ["North","Northeast","East","Southeast","South","Southwest","West","Northwest"]; +var TrackDirections = ["North","NE","East","SE","South","SW","West","NW"]; var UnitLabels = { 'altitude': { metric: "m", imperial: "ft", nautical: "ft"}, @@ -31,7 +31,7 @@ function format_track_brief(track) { return ""; } - return Math.round(track); + return Math.round(track) + DEGREES; } // track in degrees (0..359) @@ -54,7 +54,7 @@ function format_altitude_brief(alt, vr, displayUnits) { return "ground"; } - alt_text = Math.round(convert_altitude(alt, displayUnits)) + NBSP; + alt_text = Math.round(convert_altitude(alt, displayUnits)).toLocaleString() + NBSP; // Vertical Rate Triangle var verticalRateTriangle = ""; @@ -80,7 +80,7 @@ function format_altitude_long(alt, vr, displayUnits) { return "on ground"; } - alt_text = Math.round(convert_altitude(alt, displayUnits)) + NBSP + get_unit_label("altitude", displayUnits); + alt_text = Math.round(convert_altitude(alt, displayUnits)).toLocaleString() + NBSP + get_unit_label("altitude", displayUnits); if (vr > 128) { return UP_TRIANGLE + NBSP + alt_text; @@ -142,12 +142,16 @@ function format_distance_brief(dist, displayUnits) { } // dist in meters -function format_distance_long(dist, displayUnits) { +function format_distance_long(dist, displayUnits, fixed) { if (dist === null) { return "n/a"; } - var dist_text = convert_distance(dist, displayUnits).toFixed(1) + NBSP + get_unit_label("distance", displayUnits); + if (typeof fixed === 'undefined') { + fixed = 1; + } + + var dist_text = convert_distance(dist, displayUnits).toFixed(fixed) + NBSP + get_unit_label("distance", displayUnits); return dist_text; } diff --git a/public_html/index.html b/public_html/index.html index e5e9d6d..fb0c5a1 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -171,7 +171,7 @@ - AirFrames.org Link + AirFrames.org @@ -310,15 +310,15 @@