View Source Mobilizon.Cldr.Rbnf.Ordinal (Mobilizon v5.0.0-beta.1)

Functions to implement the ordinal rule-based-number-format rules of CLDR.

As CLDR notes, the data is incomplete or non-existent for many languages. It is considered complete for English however.

The standard public API for RBNF is via the Cldr.Number.to_string/2 function.

The functions on this module are defined at compile time based upon the RBNF rules defined in the Unicode CLDR data repository. Available rules are identified by:

iex> Mobilizon.Cldr.Rbnf.Ordinal.rule_sets(:en)
[:digits_ordinal]

iex> Mobilizon.Cldr.Rbnf.Ordinal.rule_sets("fr")
...> |> Enum.sort()
[
  :digits_ordinal,
  :digits_ordinal_feminine,
  :digits_ordinal_feminine_plural,
  :digits_ordinal_masculine,
  :digits_ordinal_masculine_plural
]

A rule can then be invoked on an available rule_set. For example

iex> Mobilizon.Cldr.Rbnf.Ordinal.digits_ordinal(123, :en)
"123rd"

This call is equivalent to the call through the public API of:

iex> Mobilizon.Cldr.Number.to_string(123, format: :ordinal)
{:ok, "123rd"}

Summary

Functions

Link to this function

digits_ordinal(number, locale)

View Source
Link to this function

digits_ordinal_feminine(number, locale)

View Source
Link to this function

digits_ordinal_feminine_ablative(number, locale)

View Source
Link to this function

digits_ordinal_feminine_accusative(number, locale)

View Source
Link to this function

digits_ordinal_feminine_dative(number, locale)

View Source
Link to this function

digits_ordinal_feminine_genitive(number, locale)

View Source
Link to this function

digits_ordinal_feminine_locative(number, locale)

View Source
Link to this function

digits_ordinal_feminine_plural(number, locale)

View Source
Link to this function

digits_ordinal_masculine(number, locale)

View Source
Link to this function

digits_ordinal_masculine_ablative(number, locale)

View Source
Link to this function

digits_ordinal_masculine_accusative(number, locale)

View Source
Link to this function

digits_ordinal_masculine_dative(number, locale)

View Source
Link to this function

digits_ordinal_masculine_genitive(number, locale)

View Source
Link to this function

digits_ordinal_masculine_locative(number, locale)

View Source
Link to this function

digits_ordinal_masculine_plural(number, locale)

View Source
Link to this function

digits_ordinal_neuter(number, locale)

View Source
Link to this function

digits_ordinal_neuter_ablative(number, locale)

View Source
Link to this function

digits_ordinal_neuter_accusative(number, locale)

View Source
Link to this function

digits_ordinal_neuter_dative(number, locale)

View Source
Link to this function

digits_ordinal_neuter_genitive(number, locale)

View Source
Link to this function

digits_ordinal_neuter_locative(number, locale)

View Source
Link to this function

digits_ordinal_plural(number, locale)

View Source
Link to this function

digits_ordinal_plural_ablative(number, locale)

View Source
Link to this function

digits_ordinal_plural_accusative(number, locale)

View Source
Link to this function

digits_ordinal_plural_dative(number, locale)

View Source
Link to this function

digits_ordinal_plural_genitive(number, locale)

View Source
Link to this function

digits_ordinal_plural_locative(number, locale)

View Source
Link to this function

rule_sets(rbnf_locale_name)

View Source