I m working to get the Longitude and Latitude for current place and i m using the code
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
[locationManager startUpdatingLocation];
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation{
int degrees = newLocation.coordinate.latitude;
double decimal = fabs(newLocation.coordinate.latitude - degrees);
int minutes = decimal * 60;
double seconds = decimal * 3600 - minutes * 60;
lat = [NSString stringWithFormat:@"%d° %d' %1.4f\"",
degrees, minutes, seconds];
NSLog(@" Current Latitude : %@",lat);
degrees = newLocation.coordinate.longitude;
decimal = fabs(newLocation.coordinate.longitude - degrees);
minutes = decimal * 60;
seconds = decimal * 3600 - minutes * 60;
// longt = [NSString stringWithFormat:@"%d° %d' %1.4f\"",
// degrees, minutes, seconds];
longt = [NSString stringWithFormat:@"%d° %d' %1.4f\"",
degrees, minutes, seconds];
NSLog(@" Current Longitude : %@",longt);
}
and getting the:
Current Latitude : 37° 47' 9.0024" Current Longitude : -122° 24' 23.1012"
But i want the Latitude and Longitude like that 13.233233 (mean in points). So how i can convert this in Longitude and Latitude in point ?Please help.