I have a 3543.5463N,5128.1168E value (Degree and minute base)
How do can I convert that into latitude and longitude values?
I found below code for C but I cannot convert to basic
How do can I convert that into latitude and longitude values?
I found below code for C but I cannot convert to basic
B4X:
float _loc_lat_bydegree_to_loc_lat_bypos_(char *_lat, char _ns) {
float real, img;
real = ((_lat[0] - '0') * 10) + _lat[1] - '0';
img = atof(&_lat[2]);
img = img / 60.0;
if (_ns == 'S') img = img * -1;
img = img + (float) real;
return img;
}
float _loc_long_bydegree_to_loc_long_bypos_(char *_long, char _ew) {
float real, img;
real = ((_long[0] - '0') * 100) + ((_long[1] - '0') * 10) + _long[2] - '0';
img = atof(&_long[3]);
img = img / 60.0;
if (_ew == 'W') img = img * -1;
img = img + (float) real;
return img;
}