MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
Astor1963
Posts: 23
Supporter
I am trying to see the distance data on the LCD, in:
offset 6064 8bit float
result for example 5418 meters

I'm trying to convert to Nautical Miles
$ / 0.000539957

but it does nothing, it does not give the result, I have tried with a point or a comma for the decimal.
If the meters I pass them to kilometers
$ / 1000 this if it works
Do you know why it can be??? :confused:

Cheers
2020-11-14 12:57
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
First question is.... WHAT does not work....

iconQuote:

but it does nothing, it does not give the result,



Is there a Error ( Mobiflight Stops and give you a error message in the Logging )
OR
Is your problem still that the Result is a wrong number ?


Basicly your Formula is wrong, too....

1 Meter is 0,000539957 Nautica Miles. So to get Nautical miles from Meters in your logic you must MULTIPLY ....
$*0.000539957 would be correct here....

Much more easy is inverted....
1 Nautical Mile are 1852,000674128 Meters..... We not need to talk about mm in those distances.... So simply 1Nm = 1852m
So simply $/1852


LAST NOTE:
Mobiflight execute (behind the Transform) just full Numbers. So in your example 5418 Meters Divide through 1852 result in 2,9254859~ Nautical Miles.
BUT Mobiflight will execute just "2" into the Compare or to a Display!
If you need more accurate values ( and pretty sure you need 1-2 Decimal parts like 2,92 in that case) then you need to multiply the result !

For example Value 5418 Meters $/1852 = 2,9254 Shown as "2" ..... If you use $/1852*100 =292,54 Shown as "292" .
Good Luck !
2020-11-14 14:44
Avatar
Astor1963
Posts: 23
Supporter
It is true that I am confused, I have to rest a little from hitting the button box hahaha
thanks ... :cry:
2020-11-14 17:49
icon