title: "Extra argument in call" error in Swift
body: <p>Before anyone sends me to look at a previous post, know that I've looked at a ton, and my novice status has prevented me from implementing previous answers that may or may not be relevant.</p>
  
  <p>I'm learning to code for iOS with Swift, and as an exercise I'm building a simple app to convert miles to km. The following code is working flawlessly so far:</p>
  
  <pre><code>// convert miles from string to float
  var miles = (textfieldMiles.text as NSString).floatValue
  
  // calculate kilometers
  var kilometers = miles * 1.609344
  
  // determine terminology
  var termMiles = "mile"
  if (miles != 1.00) {
      termMiles = termMiles + "s"
  }
  var termKilometers = "kilometer"
  if (kilometers != 1.00) {
      termKilometers = termKilometers + "s"
  }
  
  // display results
  labelMain.text = "\(miles) \(termMiles) = \(kilometers) \(termKilometers)"
  </code></pre>
  
  <p>I want to show the resulting miles/kms with only two digits following the decimal, so I implemented the following:</p>
  
  <pre><code>// format numbers
  miles = NSString(format:"%.2f", miles)
  </code></pre>
  
  <p>This gives me an error "extra argument in call". As best I can tell, this is because my floating value in "miles" cannot use NSString, for some reason. I have no idea how to fix this, and while I feel like some of the previous answers probably should be helpful, I don't have enough background knowledge yet to understand them. Can some kind soul explain what the solution is, and for bonus points, why the solution works?</p>