From: Deiz Date: Wed, 31 Oct 2012 17:27:41 +0000 (-0400) Subject: Teen ordinal numbers always use a 'th' suffix. X-Git-Tag: 2.7~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=638156c8b2ca6b0d62941aa96a0810ca939a1bce;p=i3%2Fi3status Teen ordinal numbers always use a 'th' suffix. --- 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");