Elixir Century From Year
defmodule CenturyFromYear do
def century_from_year(year), do: ceil(year / 100)
end
This converts a year into its century. Years 1-100 are century 1, 101-200 are century 2, and so on.
defmodule CenturyFromYear do
def century_from_year(year), do: ceil(year / 100)
end
This converts a year into its century. Years 1-100 are century 1, 101-200 are century 2, and so on.