From 51d924c1b8107597cec783dc0a15ca7f2b4d528c Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 22 Apr 2022 13:32:34 +0200 Subject: [PATCH] BRAANato - make bearing a 3digit number --- Moose Development/Moose/Core/Point.lua | 4 ++-- Moose Development/Moose/Utilities/Utils.lua | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index d4dbc4d31..36f467284 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -2792,9 +2792,9 @@ do -- COORDINATE if rangeNM > 3 then if aspect == "" then - BRAANATO = string.format("BRA, %s, %d miles, Angels %d, Track %s",bearing, rangeNM, alt, track) + BRAANATO = string.format("BRA, %03d, %d miles, Angels %d, Track %s",bearing, rangeNM, alt, track) else - BRAANATO = string.format("BRAA, %s, %d miles, Angels %d, %s, Track %s",bearing, rangeNM, alt, aspect, track) + BRAANATO = string.format("BRAA, %03d, %d miles, Angels %d, %s, Track %s",bearing, rangeNM, alt, aspect, track) end if Spades then BRAANATO = BRAANATO..", Spades." diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index f45cd7ab5..4850c263d 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -2436,7 +2436,11 @@ function UTILS.ToStringBRAANATO(FromGrp,ToGrp) local alt = UTILS.Round(UTILS.MetersToFeet(grpLeadUnit:GetAltitude())/1000,0)--*1000 local track = UTILS.BearingToCardinal(hdg) if rangeNM > 3 then - BRAANATO = string.format("%s, BRAA, %s, %d miles, Angels %d, %s, Track %s, Spades.",GroupWords,bearing, rangeNM, alt, aspect, track) + if aspect == "" then + BRAANATO = string.format("%s, BRA, %03d, %d miles, Angels %d, Track %s",GroupWords,bearing, rangeNM, alt, track) + else + BRAANATO = string.format("%s, BRAA, %03d, %d miles, Angels %d, %s, Track %s",GroupWords, bearing, rangeNM, alt, aspect, track) + end end return BRAANATO end \ No newline at end of file