PDA

View Full Version : Format conversion



Gianmaria
10-11-2006, 12:12 PM
Hi,
having a latitude like : 41,2323032

How can i format in DMS format 41 23' 23,24''


Regards
Gianmaria

Wilfried
10-11-2006, 01:36 PM
Hi,


double lat = 41.2323032;
int degree, minute;
double seconds;

degree = (int)lat;
lat -= degree;
lat *= 60;
minute = (int)lat;
lat -= minute;
lat *= 60;
seconds = lat;
string pos = degree.ToString() + '' + minute.ToString() + "'" + seconds.ToString("F2") + '"';