Is there a way to use NSNumberFormatter to get the \'th\' \'st\' \'nd\' \'rd\' number endings?
EDIT:
Looks like it does not exist. Here\'s what I\'m using.>
This does the trick in one method (for English). Thanks nickf https://stackoverflow.com/a/69284/1208690 for original code in PHP, I just adapted it to objective C:-
-(NSString *) addSuffixToNumber:(int) number
{
NSString *suffix;
int ones = number % 10;
int tens = (number/10) % 10;
if (tens ==1) {
suffix = @"th";
} else if (ones ==1){
suffix = @"st";
} else if (ones ==2){
suffix = @"nd";
} else if (ones ==3){
suffix = @"rd";
} else {
suffix = @"th";
}
NSString * completeAsString = [NSString stringWithFormat:@"%d%@", number, suffix];
return completeAsString;
}