What did yall end up settling on?

you are viewing a single comment's thread
view the rest of the comments
[–] 6 points 1 month ago* (2 children)

I have this handy little bash function, I think you should use it.

get-english-ordinal-ending() {
  case "$1" in
    *11 | *12 | *13) printf 'th' ;;
    *1) printf 'st' ;;
    *2) printf 'nd' ;;
    *3) printf 'rd' ;;
    *) printf 'th' ;;
  esac
}
  • source
  • hideshow 2 child comments