title: Convert decimal coordinate into degrees, minutes, seconds, direction
body: <p>I have the following so far, but can't figure out a tidy way to get the direction letters in without a bunch of messy if statements. Any ideas? Ideally I'd like to extend the CLLocation class with a category to do this.</p>
  
  <pre><code>-(NSString *)nicePosition{
  
  double latitude = [self.latitude doubleValue];
  double longitude = [self.longitude doubleValue];
  
  int latSeconds = (int)round(latitude * 3600);
  int latDegrees = latSeconds / 3600;
  latSeconds = abs(latSeconds % 3600);
  int latMinutes = latSeconds / 60;
  latSeconds %= 60;
  
  int longSeconds = (int)round(longitude * 3600);
  int longDegrees = longSeconds / 3600;
  longSeconds = abs(longSeconds % 3600);
  int longMinutes = longSeconds / 60;
  longSeconds %= 60;
  
  //TODO: Use N,E,S,W notation in lat/long
  
  return [NSString stringWithFormat:@"%i° %i' %i\", %i° %i' %i\"", latDegrees, latMinutes, latSeconds, longDegrees, longMinutes, longSeconds];
  }
  </code></pre>
  
  <p>For the record I did the following.</p>
  
  <pre><code>-(NSString *)nicePosition{
  
  double latitude = [self.latitude doubleValue];
  double longitude = [self.longitude doubleValue];
  
  int latSeconds = (int)round(abs(latitude * 3600));
  int latDegrees = latSeconds / 3600;
  latSeconds = latSeconds % 3600;
  int latMinutes = latSeconds / 60;
  latSeconds %= 60;
  
  int longSeconds = (int)round(abs(longitude * 3600));
  int longDegrees = longSeconds / 3600;
  longSeconds = longSeconds % 3600;
  int longMinutes = longSeconds / 60;
  longSeconds %= 60;
  
  char latDirection = (latitude &gt;= 0) ? 'N' : 'S';
  char longDirection = (longitude &gt;= 0) ? 'E' : 'W';
  
  return [NSString stringWithFormat:@"%i° %i' %i\" %c, %i° %i' %i\" %c", latDegrees, latMinutes, latSeconds, latDirection, longDegrees, longMinutes, longSeconds, longDirection];
  }
  </code></pre>