Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Next Waypoint Distance

Featured Replies

Hi,- - - %((A:GPS WP Distance,nMiles) 0 max 9999.9 min)%!3d!- - GPS_WP_DISTANCE,NMilesThis is a "Next waypoint Distance" gauge I'm working actually.Problems are:1)At the panel opening appears only 0. I would like 00.0 and always numbers have to be shown by 2 figures plus a decimal one.2)if I put as unit "nMiles" the value will be rounded to the nearest mile value.If I put as unit "DecinMiles" the value appears ,I think it's right, showing the total decinMiles.Example: If I load a flight plan where the first waypoint distance is 41.9NM if the unit in the gauge is "NMiles" I'll have shown on the panel 42(value rounded to the nearest one),if the unit is "decinMiles" on the panel appears 419.How can I manage to have on the panel as value 41.9 and always three figures as written above?Thanks in advanceG.Franco

  • Author

I'm posting a correction of my previous post.At the panel opening and always I would like four digits:000.0 not as I wrote wrongly only three.Sorry for the new message but the time was expired.Regards G.Franco

Hi,Try:%((A:GPS WP Distance,Nmiles))%!3.1f! Hope it helps,Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Hi,If you actually need leading zeroes, like "043.2", I will dare to amend Jan's line :-) because I think "f" doesn't support that.So, if you really need the leading 0's, and !3.1f! doesn't work, just try (not tested)%((A:GPS WP Distance,Nmiles) s0 int)%!03d!.%(l0 1 %)%!d! Tom

  • Author

hi Tom,thanks for the help.I tryied your string and now the leading zeros appear but the decimal is missing.The right expected distance to be shown is 041.9 with your string appears only 041 Looking at Microsoft SDK I found an example to have the altimeters showing thousand of feet: it's suggested to divide by 1000.Don't you think that using as unit "DecinMiles" and dividing by 10 it should be a good idea?I tryied it but the gauge stops working maybe I made an other error.Regards G.Franco

Hi Gianfranco,THis is the correct line:%((A:GPS WP Distance,Nmiles) s0 int)%!03d!.%(l0 1 % 10 * int)%!d! Mind the "." after the "!03d!" and before the "%" that indicates the decimal point's position.Also watch the longitude of the because if it is too short, the value won't show complete. Tom

  • Author

Hi Tom,an other step has been made.Now the distance value appears 000.0 but the decimal is stuck to zero.Decimal shows always zero.Thanks again G.Franco

  • Moderator

As Tom has mentioned, "leading zeros" will not be added to any floating point format specification. From Susan Ashlock's blog* (Lead Gauge Programmer at ACES) :%( 12.34 )%!04.3f!12.340 (Leading

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Hi,I have DME with leading 0's and decimals (eg: 003.2) using rolling numbers.Jan"Beatus ille qui procul negotiis..."

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

hi to all,now the gauge works properly!My error was due to lower case L.I typed "|" instead of "l" and this was the reason why the decimal was stuck to zero.I'm a beginner and for this issue I do have to consider how difficult is to make gauges.Thanks to all of you for the help and lesson.Regards G.Franco

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.