From 638156c8b2ca6b0d62941aa96a0810ca939a1bce Mon Sep 17 00:00:00 2001 From: Deiz Date: Wed, 31 Oct 2012 13:27:41 -0400 Subject: Teen ordinal numbers always use a 'th' suffix. --- src/print_ddate.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/print_ddate.c') 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"); -- cgit v1.2.3