Skip to content

Instantly share code, notes, and snippets.

@alexbosworth
Created October 22, 2015 02:34
Show Gist options
  • Save alexbosworth/a3445c51cfc68ec6c759 to your computer and use it in GitHub Desktop.
Save alexbosworth/a3445c51cfc68ec6c759 to your computer and use it in GitHub Desktop.
func localizedStringForNumber(number: Int) -> String {
let numberFormatter = NSNumberFormatter()
numberFormatter.locale = NSLocale.currentLocale()
numberFormatter.numberStyle = .NoStyle
return numberFormatter.stringFromNumber(number) ?? String(number)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment