diff options
author | Deiz <silverwraithii@gmail.com> | 2012-10-31 13:27:41 -0400 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2012-11-06 00:26:47 +0100 |
commit | 638156c8b2ca6b0d62941aa96a0810ca939a1bce (patch) | |
tree | eaee18800b4b77ac61d915342951780cfc5bfea6 /src | |
parent | beaaf4c742036e0f02fa9867e4cd44b13faac5a2 (diff) |
Teen ordinal numbers always use a 'th' suffix.
Diffstat (limited to 'src')
-rw-r--r-- | src/print_ddate.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/print_ddate.c b/src/print_ddate.c index 6d39c51..8213862 100644 --- a/src/print_ddate.c +++ b/src/print_ddate.c @@ -95,6 +95,11 @@ static int format_output(char *outwalk, char *format, struct disc_time *dt) { break; case 'e': outwalk += sprintf(outwalk, "%d", dt->season_day + 1); + if (dt->season_day > 9 && dt->season_day < 13) { + outwalk += sprintf(outwalk, "th"); + break; + } + switch (dt->season_day % 10) { case 0: outwalk += sprintf(outwalk, "st"); |