title: Add remove currency formatting in Swift
body: <p>I use </p>
  
  <pre><code>func formatAmount(number:NSNumber) -&gt; String {
      let formatter = NSNumberFormatter()
      formatter.numberStyle = .CurrencyStyle
      return formatter.stringFromNumber(number)!
  }
  </code></pre>
  
  <p>for changing the number to currency formatted string, but I need to remove the formatting and get just number, I need to remove the comma and currency symbol. is there any specific way? Please let me know.</p>
  
  <p>I tried </p>
  
  <pre><code>func removeFormatAmount(string:String) -&gt; NSNumber {
      let formatter = NSNumberFormatter()
      formatter.numberStyle = .NoStyle
      formatter.currencySymbol = .None
      formatter.currencyGroupingSeparator = .None
      return formatter.numberFromString(string)!
  }
  </code></pre>
  
  <p>and this gives me nil value.</p>
  
  <p><strong>UPDATE</strong>
  I figured out that if text does not contain $ sign then formatting with currency will give nil value so what I did is</p>
  
  <pre><code>if string.containsString("$") {
      formatter.numberStyle = .CurrencyStyle
  }
  return formatter.numberFromString(string)?.floatValue
  </code></pre>
  
  <p>now it just gives me good result.</p>