title: Swift playground - How to convert a string with comma to a string with decimal
body: <p>I'm new in the Swift world.</p>
  
  <p>How can I converting a String with a comma to a String with a decimal?</p>
  
  <p>The code work's fine with a dot (.)</p>
  
  <p>The problem is when I'm using a comma (,) ... with: <strong>var price</strong></p>
  
  <p>The origin of the problem is the Decimal french keyboard use a comma (,) instead of a dot (.)</p>
  
  <p>Don't know exactly how to use <strong>NSNumberFormatter</strong> or <strong>generatesDecimalNumbers</strong> if it's the key. There's probebly more than one options.</p>
  
  <pre><code>//The answer change if "2,25" or "2.25" is used.
  
  var price      : String = "2,25"
  var priceFloat = (price as NSString).floatValue
  
  //I need to have 2.25 as answer.
  
  var costString = String(format:"%.2f", priceFloat)
  </code></pre>
  
  <p>Thank's for your time and your help!</p>