package ordinal_abbreviation

  1. Overview
  2. Docs
module type S = sig ... end

Conversions for Int

include S with type integer := Base.int
val to_string : Base.int -> 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.int -> 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.int -> Base.string

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

Conversions for Other Built-in Integer Types

module Int32 : S with type integer := Base.int32
module Int63 : S with type integer := Base.Int63.t
module Int64 : S with type integer := Base.int64
module Nativeint : S with type integer := Base.nativeint

Conversions for Arbitrary Integer Types

module Make (Integer : Base.Int.S_common) : S with type integer := Integer.t
OCaml

Innovation. Community. Security.