Archived

This topic is now archived and is closed to further replies.

WarpD

Formatted Text Syntax - XML

Recommended Posts

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}				%			

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

mod the decimal minutes and multiply the result by 60 to get the seconds.

Share this post


Link to post
Share on other sites