src/main/java/org/organicdesign/fp/FunctionUtils.java
public static String ordinal(final int origI) {
        final int i = (origI < 0) ? -origI : origI;
        final int modTen = i % 10;
        if ( (modTen < 4) && (modTen > 0)) {
            int modHundred = i % 100;
            if ( (modHundred < 21) && (modHundred > 3) ) {
                return Integer.toString(origI) + "th";
            }
            switch (modTen) {
                case 1: return Integer.toString(origI) + "st";
                case 2: return Integer.toString(origI) + "nd";
                case 3: return Integer.toString(origI) + "rd";
            }
        }
        return Integer.toString(origI) + "th";
    }
public static String ordinal(final int origI) {
        final int i = (origI < 0) ? -origI : origI;
        final int modTen = i % 10;
        if ( (modTen < 4) && (modTen > 0)) {
            int modHundred = i % 100;
            if ( (modHundred < 21) && (modHundred > 3) ) {
                return Integer.toString(origI) + "th";
            }
            switch (modTen) {
                case 1: return Integer.toString(origI) + "st";
                case 2: return Integer.toString(origI) + "nd";
                case 3: return Integer.toString(origI) + "rd";
            }
        }
        return Integer.toString(origI) + "th";
    }
public static String ordinal ( final int origI ) { final int i = ( origI < 0 ) ? - origI : origI ; final int modTen = i % 10 ; if ( ( modTen < 4 ) && ( modTen > 0 ) ) { int modHundred = i % 100 ; if ( ( modHundred < 21 ) && ( modHundred > 3 ) ) { return Integer . toString ( origI ) + "th" ; } switch ( modTen ) { case 1 : return Integer . toString ( origI ) + "st" ; case 2 : return Integer . toString ( origI ) + "nd" ; case 3 : return Integer . toString ( origI ) + "rd" ; } } return Integer . toString ( origI ) + "th" ; }
}
}