I am not afraid of the automatic way. You need to use some kind of custom method. Here is the one I used in the past:
String getOrdinal(final int day) { if (day >= 11 && day <= 13) { return "th"; } switch (day % 10) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; default: return "th"; } }
source share