# FORMATTING VALUES IN XML

## Recommended Posts

Hello all,Question from a beginner in xml :I would like, on my gauge which shows Time to Station in minutes, to split values of tens and units.How to format these values so.*******FOR TEN of minutes************ (A:nav2 dme,nmiles) (A:GROUND VELOCITY,knots) / 60 * flr 60 *********For UNITS of minutes*********** (A:nav2 dme,nmiles) (A:GROUND VELOCITY,knots) / 60 * flr 60 With this formula I get a good result with String when i use text but would like to show an image of each digit depending on the value read (Case value).Hope I'm clear enough.Thanks for your supportBRGDSDan

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

Hello Dan Try (A:nav2 dme,nmiles) (A:GROUND VELOCITY,knots) /60 * flr 60 ETC. ----------

##### Share on other sites

Hi PVEIn fact my problem is in the expression of the value .I ve got some problems to understand the use of "flr" expression.I would like to create two elements (so as to avoid to create 99 bitmaps for each value) One for the Tens and one for the units.Could someone explain me the use of "flr" "near" and so on expressions.Anyway thanks a lot for your quick answer.Dan

##### Share on other sites

I don't think you're going to be able to accomplish what you want using .bmps without using the % (modulus) function. Somehow you need to be able to strip the "ones" place out of your minutes and round it to the nearest whole number of "0" through "9". Instead of making 99 .bmps (you'd need 100 actually if you count zero) you can make 10 and re-use them for each place (tens, and ones) as a new element. (A:NAV2 DME,nautical miles) (A:GROUND VELOCITY,knots) / 6 * flr ---- ETC ---- (A:NAV2 DME,nautical miles) (A:GROUND VELOCITY,knots) / 60 * 10 % near ---- ETC ---- Check out Bill's reply in this thread for a good explanation of the modulus function:http://forums.avsim.net/dcboard.php?az=sho...&topic_id=25560"flr" (floor) rounds the last value on the stack down to the nearest whole number. "near" simply rounds to the nearest whole number. There's some info on these operators/modifiers or whatever they're called in "Panels SDK.doc" from the FS9 SDK. Also download "xmlgau01.zip" from the library.Jim

##### Share on other sites

Thanks a lot Jim!!!!You're the man !That's exactly what i wanted to do!Indeed I will have to learn a lot more on operators.It's just the beginning....of a long story!BRGDSDan

##### Share on other sites

Hi,You can also change the 747 altimeter code (shift)Instead of indicated altitude use distance/speedNow you only need one bitmap (rolling number)Jan

##### Share on other sites

>Check out Bill's reply in this thread for a good explanation>of the modulus function:>>http://forums.avsim.net/dcboard.php?az=sho...&topic_id=25560OMG, Jim! You really dug deep with the Search engine to find that! ;)I can't believe I actually wrote that now. I must have remembered to take my "smart pills" that week... *:-*

##### Share on other sites

Bill I didn't have to do any diggin' at all to find that one, I've had that thread "shortcutted, bookmarked, favorited, saved, and dog-eared" for a long time now :) . I still refer to it almost every time I use that function (that and a little Excel "cheat sheet" I made). Thanks for a great explanation. Heck, I always figured you were on a hefty dose of those "smart pills" every week...Glad that worked out for you, Dan :) .Jim

##### Share on other sites

>would like to create two elements (so as to avoid to create 99>bitmaps for each value) One for the Tens and one for the>units.Could someone explain me the use of "flr" "near" and so>on expressions.Dan, if you aren't interested in "rolling numbers," there are still two possible approaches, both of which are very cost effective.1. Use the "rolling number" type bitmap, but have the numbers "snap" to position rather than rolling.2. Use a to print your numbers using any font available (or a custom font if you want to have something 'special.').

##### Share on other sites

Thanks to all of you for your kind support.It's always nice to see that the spirit of solidarity hasn't totally disappeared nowadays from this planet (at least in flightsim community).With all your advices my KN62 is progressing nicely and should be ready in a few days.For this kind of gauges I preferred to use bitmaps iso fonts so as to reproduce as close as possible the font used by Bendix on its instruments.Hope you'll enjoy.BRGDS & Thanks again.Daniel

##### Share on other sites

I think in the future I will also need your help for the next gauges I want to realize and hope i won't annoy you with my silly questions.I must admit i'm better at artwork (if some of you have the tinmouse 737-200 you "admire lol" each time you use the pedestal panel my contribution (I had done all the bitmaps) to the wonderful work of Richard Probst. See yoou soon Daniel

##### Share on other sites
http://forums.avsim.net/user_files/180671.jpgJust a small preview of all modes available on this gauge .Still have the mode selector button to do and that's it.Thanks again for your patienceBRGDSDan

## Create an account

Register a new account

• Tom Allensworth,
Founder of AVSIM Online

• ### Hot Spots

• 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!