package ordinal_abbreviation

  1. Overview
  2. Docs
val to_string : Base.int32 -> Base.string

Produces an ordinal abbreviation string, e.g. to_string 13 = "13th", to_string 100002 = "100002nd", etc.

val to_string_hum : ?delimiter:Base.char -> Base.int32 -> Base.string

Produces an ordinal abbreviation string with delimiters every three digits, e.g. to_string 13 = "13th", to_string 100002 = "100_002nd", etc.

val to_suffix : Base.int32 -> Base.string

Produces the appropriate ordinal suffix to append to an integer, e.g. to_suffix 3 = "rd", to_suffix 100002 = "nd", etc.

OCaml

Innovation. Community. Security.