I need to write numbers like: 1>yek
123>yeksad o bist o se
1,123>yek hezar o yeksad o bist o se
3,002,001>se milion o do hezar o yek ...
I
Swift version of @Vladimir answer (Just in case)
let formatter = NSNumberFormatter()
formatter.numberStyle = .SpellOutStyle
formatter.locale = NSLocale(localeIdentifier: "en_US")
let string = formatter.stringFromNumber(55015515)
NSNumberFormatter class has built-in functionality for conversion numbers to words:
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle: NSNumberFormatterSpellOutStyle];
[formatter setLocale:...]; // Set locale if you want to use something other then the current one
NSString* numberString = [formatter stringFromNumber:[NSNumber numberWithInt: 100]];