Permalink
Browse files

Improves the output for numbers such as 111 that should be written wi…

…th 'th' ordinals not 'st'.
  • Loading branch information...
1 parent 00cf3ac commit 2477963a11c2a355d92da0dad4c8ec2af31705bd James Addyman committed Nov 12, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 ADNOrdinalNumberFormatter.m
View
2 ADNOrdinalNumberFormatter.m
@@ -28,7 +28,7 @@ - (NSString *)stringForObjectValue:(id)anObject {
NSString *ordinal;
- if ([strRepresentation isEqualToString:@"11"] || [strRepresentation isEqualToString:@"12"] || [strRepresentation isEqualToString:@"13"]) {
+ if ([strRepresentation hasSuffix:@"11"] || [strRepresentation hasSuffix:@"12"] || [strRepresentation hasSuffix:@"13"]) {
ordinal = @"th";
} else if ([lastDigit isEqualToString:@"1"]) {
ordinal = @"st";

0 comments on commit 2477963

Please sign in to comment.