CXA001 Posted August 7, 2016 Report Posted August 7, 2016 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
Thomas Richter Posted August 7, 2016 Report Posted August 7, 2016 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
CXA001 Posted August 7, 2016 Author Report Posted August 7, 2016 Ah Ha! Thanks for resolving the mystery! Regards, Marc
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now