title: How can I convert a currency string to a number ignoring separators?
body: <p>I have a <code>NumberFormatter</code> (called <code>currencyFormatter</code>) which is configured to convert a <code>String</code>, such as "£1,000" to the <code>NSDecimalNumber</code> 1000 using the following code:</p>
  
  <pre><code>// Configuration
  let currencyFormatter = NumberFormatter()
  currencyFormatter.numberStyle = .currency
  currencyFormatter.currencyCode = "GBP"
  
  // Usage
  currencyFormatter.number(from: "£1,000")
  </code></pre>
  
  <p>If I omit the commas from the string the conversion still works but, if the commas as misplaced ("£10,00" for example), the method fails, returning nil.</p>
  
  <p>While I could remove all the commas, this would cause issues in locales which use a comma as the decimal separator and the period in place of the comma.</p>
  
  <p>Is there a safe way I can loosen the requirements of the thousands-separator (commas, periods or whatever character any other currency might use) placement in the <code>NumberFormatter</code> slightly but without allowing unreasonable conversion?</p>
  
  <p>Many thanks in advance.</p>