Jump to content
The simFlight Network Forums

please help for bank angle (Solved)

Recommended Posts

dear pete and all developers

i want to read bank angle offset with delphi i read someting but i need some format for this value

my code is this

function TFSUIPC.GetBankAngle: Real;
  deger : Integer;
  rDeger : Real;
  FSUIPC_Read($057C, 4, @deger, dwResult);
  if FSUIPC_Process(dwResult) then
    rDeger := deger * 360 / (65536.0 * 65536.0);
    Result := rDeger;
  end else
    Result := 5;

and return value is this


im not good numeric value formating with delphi i want to this result someting like this

20 degrees 10 degrees etc.

thank you for all helps

Link to comment
Share on other sites

rDeger := deger * 360 / (65536.0 * 65536.0);

At which stage is your compiler converting the integer in "deger" to floating point? If this is AFTER the multiplication by 360 you are likely to lose most of the value though overflow!


rDeger = deger; // Convert to floating ponit

rDeger = (rDeger * 360.0) / (65536.0 * 65536.0); // convert to degrees


Link to comment
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
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.