plotex v0.2.1 Plotex.Cldr.Rbnf.Spellout
Functions to implement the spellout 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> Plotex.Cldr.Rbnf.Spellout.rule_sets("en")
[:spellout_ordinal_verbose, :spellout_ordinal, :spellout_numbering_year,
:spellout_numbering_verbose, :spellout_numbering, :spellout_cardinal_verbose,
:spellout_cardinal]
A rule can then be invoked on an available rule_set. For example:
iex> Plotex.Cldr.Rbnf.Spellout.spellout_ordinal(123, "en")
"one hundred twenty-third"
This call is equivalent to the call through the public API of:
iex> Plotex.Cldr.Number.to_string(123, format: :spellout)
{:ok, "one hundred twenty-three"}
Link to this section Summary
Link to this section Functions
Link to this function
2d_year(number, language_tag)
Link to this function
all_rule_sets()
Link to this function
number and language_tag
Link to this function
and_o(number, language_tag)
Link to this function
commas(number, language_tag)
Link to this function
commas_o(number, language_tag)
Link to this function
rule_sets(rbnf_locale_name)
Link to this function
spellout_cardinal(number, locale)
Link to this function
spellout_cardinal_verbose(number, locale)
Link to this function
spellout_numbering(number, locale)
Link to this function
spellout_numbering_verbose(number, locale)
Link to this function
spellout_numbering_year(number, locale)
Link to this function
spellout_ordinal(number, locale)
Link to this function
spellout_ordinal_verbose(number, locale)
Link to this function
th(number, language_tag)
Link to this function