title: Swift – String with comma-separator to double
body: <p>I have currently a string like this: <code>"8,0"</code> or <code>"4,25"</code> and I need to convert it to a <code>Double</code>, but how would I do that?
  Do I first replace the <code>,</code> with a <code>.</code>?</p>
  
  <p>I have looked at <code>NSNumberFormatter</code> but that returned <code>nil</code> for every string.</p>
  
  <pre><code>let formatter = NSNumberFormatter()
  formatter.minimumFractionDigits = 2
  formatter.maximumFractionDigits = 2
  let grade = formatter.numberFromString(grade["Cijfer"].stringValue)
  print(grade)
  </code></pre>
  
  <p>What should I use?</p>