Skip to content

andrewhao/ordinal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ordinal

Converts a simple integer (2) to an ordinalized string ("2nd")

Usage

iex> Ordinal.ordinalize(1)
"1st"

iex> Ordinal.ordinalize(11)
"11th"

iex> Ordinal.ordinalize(111)
"111th"

iex> Ordinal.ordinalize(0)
"0th"

Installation

If available in Hex, the package can be installed by adding ordinal to your list of dependencies in mix.exs:

def deps do
  [
    {:ordinal, "~> 0.2.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ordinal.

About

Simple Elixir ordinalization of numbers to their ordinalized forms

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages