title: Convert Kelvin into Celsius in Swift
body: <p>I'm trying to retrieve the temperature from the users current location. </p>
  
  <p>I am using the API from OpenWeatherMap. The problem is, they provide the temperature in Kelvin as default, and I would like it in Celsius. </p>
  
  <p>I understand that I just need to subtract 273.15 from the kelvin value....? But i'm struggling to figure out where to do that.</p>
  
  <p>My code for setting my labels:</p>
  
  <pre><code>var jsonData: AnyObject?
  
  func setLabels(weatherData: NSData) {
  
      do {
  
          self.jsonData = try NSJSONSerialization.JSONObjectWithData(weatherData, options: []) as! NSDictionary
  
      } catch {
          //handle error here
  
      }
  
      if let name = jsonData!["name"] as? String {
  
          locationLabel.text = "using your current location, \(name)"
  
      }
  
      if let main = jsonData!["main"] as? NSDictionary {
          if let temperature = main["temp"] as? Double {
  
              self.tempLabel.text = String(format: "%.0f", temperature)
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>Can anyone help me get this right please, as I'm really not sure where to start, thanks. </p>
  
  <p>Let me know if you need to see more of my code. </p>