Skip to content

Commit 9de2f71

Browse files
committed
Round Altimeter
Round altimeter to the nearest 10's place to account for rounding errors during conversions
1 parent c1b07e3 commit 9de2f71

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/screens/F18_HUD.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ def draw(self, aircraft, smartdisplay):
102102
)
103103

104104
# ALT
105+
baroalt = round(aircraft.BALT/10)
106+
baroalt = baroalt * 10
105107
smartdisplay.draw_box_text_with_big_and_small_text(
106108
smartdisplay.RIGHT_MID, # postion
107109
self.fontIndicator, # big font
108110
self.fontAltSmall, # little font
109-
"%s" % (aircraft.BALT), # text
111+
"%s" % (baroalt), # text
110112
2, # how many chars on the right do I want in small text.
111113
(255, 255, 0), # text color
112114
5, # total char space length (padding)

0 commit comments

Comments
 (0)