We're a place where coders share, stay up-to-date and grow their careers.
F#
let whatCenture (year: int) = let centure = year / 100 + 1 let suffix x = if (centure % 13) = 12 || (centure % 13) = 11 then "th" else match x % 10 with | 1 -> "st" | 2 -> "nd" | 3 -> "rd" | _ -> "th" (string centure) + (suffix centure)
Always nice to see another F# solution :-)
Thanks
F#
Always nice to see another F# solution :-)
Thanks