05/02/11 11:41:07
>>401
またまた貴重なご指摘ありがとうございます。
addSuffix :: Int -> String
addSuffix x
| x == 11 = s ++ "th"
| x == 12 = s ++ "th"
| x == 13 = s ++ "th"
| mod x 10 == 1 = s ++ "st"
| mod x 10 == 2 = s ++ "nd"
| mod x 10 == 3 = s ++ "rd"
| otherwise = s ++ "th"
where s = show x