Created
October 19, 2014 20:31
-
-
Save ayanonagon/9f653365c9a920ff0a89 to your computer and use it in GitHub Desktop.
Changing the locale in a Swift playground
This file contains 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
import UIKit | |
extension NSLocale { | |
class func currentLocale() -> NSLocale { | |
return NSLocale.localeWithLocaleIdentifier("en_GB"); | |
} | |
} | |
NSLocale.currentLocale().localeIdentifier | |
let numberFormatter = NSNumberFormatter() | |
numberFormatter.numberStyle = NSNumberFormatterStyle.CurrencyStyle | |
numberFormatter.stringFromNumber(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Swift 4 version: