Jump to content
The simFlight Network Forums

Lat & Longs between returned with comma instead of decimal


CXA001

Recommended Posts

We are in the process of beta-testing our new ACARs software and over all it is going very well.

However, I have a very particular case where FSUIPC is returning the current latitude and longitude for one pilot only with commas instead of decimals.

LAT= 47,464698792 instead of 47.464698792

 LONG = 8,5491695404 instead of 8.5491695404

Offset<long> FSUIPCLatitude = new Offset<long>("FSUIPCLatitude", 0x0560); // Offset for Latitude.
Offset<long> FSUIPCLongitude = new Offset<long>("FSUIPCLongitude", 0x0568); // Offset for Longitude.
  
//Current latitude and longitude from FSUPIC.
stringCurrentLatitude = Convert.ToString(FSUIPCLatitude.Value * 90m / (10001750m * 65536m * 65536m));
doubleCurrentLatitude = Convert.ToDouble(stringCurrentLatitude);
stringCurrentLongitude = Convert.ToString(FSUIPCLongitude.Value * 360m / (65536m * 65536m * 65536m * 65536m));
doubleCurrentLongitude = Convert.ToDouble(stringCurrentLongitude);

Worse case, I could put in some code to replace the comma in the string with a decimal, but I found this very strange especially since only one pilot is experiencing this.

Any ideas on what would cause this?

Regards,

Marc

 

Link to comment
Share on other sites

Hi,

that is related to the language setting that is used on that PC. In metric system for decimal a comma is used and the thousand divider a dot.

So in metric one million is written as 1.000.000,00

That means if you have members from e.g. Germany then you need to convert comma into dot.

Thomas

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.