title: Swift Currency Format ISO Standard Conversion Issues
body: <p>After reading the Apple Documents for NSNumberFormatter <a href="https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/Foundation/Classes/NSNumberFormatter_Class/index.html#//apple_ref/occ/instp/NSNumberFormatter/locale" rel="nofollow">here</a> I'm trying to convert currency as per the Uber API Documentation.  Both documentations state that they use the ISO formatting standard, however in my code I find this to not be the case.  ISO 4217 Standard <a href="http://www.xe.com/iso4217.php" rel="nofollow">here</a>
   and at ISO <a href="http://www.iso.org/iso/home/standards/currency_codes.htm" rel="nofollow">itself</a></p>
  
  <pre><code>public static func convertStringCurrencyToNumber(strCurrency:String, locale:String)-&gt;Double {
      var formatter = NSNumberFormatter()
      formatter.locale = NSLocale(localeIdentifier: "\(locale)")
      formatter.numberStyle = NSNumberFormatterStyle.CurrencyStyle
      println(formatter.numberFromString(strCurrency))
      if let converted:Double = formatter.numberFromString(strCurrency)?.doubleValue {
          return converted
      }else{
          return 0.0
      }
  
  }
  </code></pre>
  
  <p>My Unit Test for this function</p>
  
  <pre><code>func testCurrencyConversion() {
      let fiveBucks = UberReceipt.convertStringCurrencyToNumber("$5.00", locale: "en_US")
      println(fiveBucks)
      let tenBucks = UberReceipt.converStringCurrencyToNumber("$10.00", locale:"USD")
      println(tenBucks)
  }
  </code></pre>
  
  <p>Console Log:
  Optional(5.0)
  nil
  5.0
  0.0</p>
  
  <p>If I use "en_US" the result is as expect, which would be 5.0, however if I use what Uber returns as the locale "USD", the return value is 0.0.  Upon printing/inspecting what happens when the formatter converts the currency, I find that it returns nil.  </p>
  
  <p>I find the documentation misleading in regards to what it says about formatter.locale = NSLocale(...).  According to the docs "The locale determines the default values for many formatter attributes, such as ISO country and language codes, <strong>currency code</strong>...."</p>
  
  <p>I was under the believe that setting the locale <strong>should</strong> also set the currency code.  Is this incorrect?  Why then does my code work if I use the non-standard "en_US" code as apposed to the ISO code (which is supposed to be what Apple Documentation uses) "USD"</p>