NSNumberFormatter and 'th' 'st' 'nd' 'rd' (ordinal) number endings
- by jan
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.
+(NSString*)ordinalNumberFormat:(NSInteger)num{
NSString *ending;
int ones = num % 10;
int tens = floor(num / 10);
tens = tens % 10;
if(tens == 1){
ending = @"th";
…