Sign in to follow this  
Guest greenco

XML String Format Problem

Recommended Posts

I want to display a leading zero in front of my "ADF Frequency", on a gauge I am making. I want the gauge to show this format "0654.0" and not like this "654.0". The articles I have found on the subject states that putting a zero in front of the "format specs" will do it. I have set the "Length=" at 5,6,7 and 8, to see if it was the problem, but it makes no difference. As soon as I increase the frequecy above "999.9", it will display this "1099.9". These two examples produce the same results. %((A:Adf active frequency:1,Kilohertz))%!4.1f!and%((A:Adf active frequency:1,Kilohertz))%!04.1f!What am I missing?greenco

Share this post


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

Hi,Try:%((A:Adf ACTIVE frequency:1, KHz))%!06.1f!Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites

Use 06.1f, NOT 04.1f :-) This WILL do what you want (just tried it)Note: the format spec x.yf (like in "C") means:A total of "x" positions (including the "."), with "y" positions as fraction.Rob BarendregtEDIT: Jan just beat me ...:-)

Share this post


Link to post
Share on other sites

Thanks to both of you, the info did exactly what I wanted. I am making myself a lot of notes.greenco

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this