Created
          October 11, 2018 06:44 
        
      - 
      
 - 
        
Save Alexander-Ignition/2c752b05a64ab0feb62b7af935c20999 to your computer and use it in GitHub Desktop.  
    Currency Symbol
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | extension Locale { | |
| static func locale(forCurrencyCode currencyCode: String) -> Locale? { | |
| return availableIdentifiers.lazy | |
| .map { Locale(identifier: $0) } | |
| .first { $0.currencyCode == currencyCode } | |
| } | |
| static func currencySymbol(forCurrencyCode currencyCode: String) -> String? { | |
| return locale(forCurrencyCode: currencyCode).flatMap { $0.currencySymbol } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment