Skip to content

Instantly share code, notes, and snippets.

@yossan
Created September 8, 2015 14:41
Show Gist options
  • Save yossan/be403b29f43f9d8f79d9 to your computer and use it in GitHub Desktop.
Save yossan/be403b29f43f9d8f79d9 to your computer and use it in GitHub Desktop.
import Foundation
let ret = NSNumberFormatter.localizedStringFromNumber(111111111, numberStyle:NSNumberFormatterStyle.SpellOutStyle)
print("ret = \(ret)")
let nf = NSNumberFormatter()
nf.locale = NSLocale(localeIdentifier:"ja_JP")
nf.numberStyle = NSNumberFormatterStyle.SpellOutStyle
let str = nf.stringFromNumber(100100)
print("val = \(str!)")
let num = nf.numberFromString("十万百")
print("num = \(num)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment