我有这个功能
public string getCoordinates(double latitude, double longitude)
{
int latSeconds = (int)Math.Round(latitude * 3600);
int latDegrees = latSeconds / 3600;
latSeconds = Math.Abs(latSeconds % 3600);
int latMinutes = latSeconds / 60;
latSeconds %= 60;
int longSeconds = (int)Math.Round(longitude * 3600);
int longDegrees = longSeconds / 3600;
longSeconds = Math.Abs(longSeconds % 3600);
int longMinutes = longSeconds / 60;
longSeconds %= 60;
string result = string.Format("{0}° {1}' {2}\" {3}, {4}° {5}' {6}\" {7}",
Math.Abs(latDegrees),
latMinutes,
latSeconds,
latDegrees >= 0 ? "N" : "S",
Math.Abs(longDegrees),
longMinutes,
longSeconds,
latDegrees >= 0 ? "E" : "W");
return result;
}
它从double转换为字符串纬度和经度我需要反转,我有这种格式的字符串纬度和经度,我想将它转换为双倍的任何想法
请帮助