November 13, 200817 yr Moderator I am trying to calculate the estimated time to a VOR/DME and display as MM:SS. DME miles/groundspeed * 60 gives me minutes.decimal minutes......the minutes will display, but how can I get the seconds? *:-* %((A:NAV1 DME, nmiles) (A:GPS GROUND SPEED, knots) / 60 * s8 0 > and)%{if}%(l8)%!02d!:%(l8 60 /)%!02d!%{else}00:00%{end}The above is part of a formatted text string: (A:GPS drives nav1,bool) 0 == {tabs=8L,125L,247L,370L} %{fnt1}{clr}WPT {fnt}{clr2}%((A:NAV1 IDENT, string))%!s! %{fnt1}t{clr}BRG {fnt}{clr2}%((A:GPS IS ACTIVE WAY POINT, bool))%{if}%((A:GPS WP BEARING, degrees) d360)%!03d!{dplo= }{fnt1} M%{end} %{fnt1}t{clr}DIS {fnt}{clr2}%((A:NAV1 HAS DME, bool) (A:NAV1 DME, nmiles) s9 0 > and)%{if}%(l9)%!04.2f!{fnt1} NM%{else}-- --.-- --%{end}%{end} %{fnt1}t{clr}ETE {fnt}{clr2}%((A:NAV1 DME, nmiles) (A:GPS GROUND SPEED, knots) / 60 * s8 0 > and)%{if}%(l8)%!02d!:%(l8 60 /)%!02d!%{else}00:00%{end} % (A:GPS drives nav1,bool) {tabs=8L,125L,247L,370L} %{fnt1}{clr}WPT {fnt}{clr2}%((A:GPS IS ACTIVE WAY POINT, bool))%{if}%((A:GPS WP NEXT ID, string))%!s!%{end} %{fnt1}t{clr}BRG {fnt}{clr2}%((A:GPS IS ACTIVE WAY POINT, bool))%{if}%((A:GPS WP BEARING, degrees) d360)%!03d!{dplo= }{fnt1} M%{end} %{fnt1}t{clr}DIS {fnt}{clr2}%((A:GPS IS ACTIVE WAY POINT, bool))%{if}%((A:GPS WP DISTANCE, nautical miles) abs)%!04.2f!{fnt1}NM% %{fnt1}t{clr}ETE {fnt}{clr2}%((A:GPS IS ACTIVE WAY POINT, bool))%{if}%((A:GPS WP ETE, hours) flr 100 %)%!02d!:%((A:GPS WP ETE, minutes) flr 60 %)%!02d!%{else}_ _:_ _%{end} % Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
November 13, 200817 yr Author Commercial Member mod the decimal minutes and multiply the result by 60 to get the seconds. Ed Wilson Mindstar AviationMy Playland - I69
Create an account or sign in to comment