我需要格式化我的座標是這樣的:如何格式化這樣的座標?
N 61° 14.5919'
E 23° 28.1751'
現在我的座標是這樣的:
61.145919
23.281751
我的代碼:
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
latitudeLabel.text = [NSString stringWithFormat:@"%f", newLocation.coordinate.latitude];
longitudeLabel.text = [NSString stringWithFormat:@"%f", newLocation.coordinate.longitude];
}
[這] [1]的信息可以幫助你。請享用! [1]:http://stackoverflow.com/questions/8851816/convert-decimal-coordinate-into-degrees-minutes-seconds-direction – parilogic 2012-08-09 07:42:34