Cldr Numbers v0.2.1 Cldr.Rbnf.Ordinal View Source

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> Cldr.Rbnf.Ordinal.rule_sets Cldr.Locale.new("en")
[:digits_ordinal]

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

iex> Cldr.Rbnf.Ordinal.digits_ordinal 123, Cldr.Locale.new("en")
"123rd"

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

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

Link to this section Summary

Link to this section Functions

Link to this function digits_ordinal(number, language_tag) View Source
Link to this function digits_ordinal_feminine(number, language_tag) View Source
Link to this function digits_ordinal_feminine_plural(number, language_tag) View Source
Link to this function digits_ordinal_indicator(number, language_tag) View Source
Link to this function digits_ordinal_masculine(number, language_tag) View Source
Link to this function digits_ordinal_masculine_plural(number, language_tag) View Source