Jump to content
Sign in to follow this  
Guest JeanLuc_

XML format specification enabling leading zeroes ?

Recommended Posts

I want to print a decimal number in XML with leading zeroes.E.g. value "1" using the format spec. !4d! is printed as "1"; I want it printed as "0001"Is this possible, and how ?Rob

Share this post


Link to post
Share on other sites
Guest Ron Freimuth

>I want to print a decimal number in XML with leading zeroes.>E.g. value "1" using the format spec. !4d! is printed as "1";>I want it printed as "0001">Rob".. C%((L:Count,enum))%!6d%" displays values like " C000123" for me, maybe due to only one "!". Unless it's the 'enum' type. Ron

Share this post


Link to post
Share on other sites

Hi Arne,!04d! did it :-)If you don't mind my asking: how does one obtain this kind of info (other than asking in this forum :-) ) ?The panel SDK is very limited on XML, and without your XML introduction document I would have been nowhere with all the XML gauges I've made.Thanks, Rob

Share this post


Link to post
Share on other sites
Guest Ron Freimuth

>Hi Arne,>>!04d! did it :-)>>If you don't mind my asking: how does one obtain this kind of>info (other than asking in this forum :-) ) ?>Thanks, Rob I just tried different varations in my Test Gauges. I knew about things like !04d and had looked over the C formats in Arne's XML archive. For some reason what I'd copied and pasted into my reply worked for my 'count' variable.>The panel SDK is very limited on XML, and without your XML>introduction document I would have been nowhere with all the>XML gauges I've made. Hopefully, something better will be in an SDK for FS9 'XML'. Which appears to be more powerful and not such a cludge. Ron

Share this post


Link to post
Share on other sites
Guest JeanLuc_

It looks like a typical parameter in C when using printf. A lot of similarities (it would have been "%04d" in C)I wonder if !04X! works too (hexadecimal number with leading 0)

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...