View Source Bonfire.Common.Localise.Cldr.Rbnf.Spellout (Bonfire v0.9.10-classic-beta.169)

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> Bonfire.Common.Localise.Cldr.Rbnf.Spellout.rule_sets("en")
...> |> Enum.sort()
[
  :spellout_cardinal,
  :spellout_cardinal_verbose,
  :spellout_numbering,
  :spellout_numbering_verbose,
  :spellout_numbering_year,
  :spellout_ordinal,
  :spellout_ordinal_verbose
]

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

iex> Bonfire.Common.Localise.Cldr.Rbnf.Spellout.spellout_ordinal(123, "en")
"one hundred twenty-third"

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

iex> Bonfire.Common.Localise.Cldr.Number.to_string(123, format: :spellout)
{:ok, "one hundred twenty-three"}

Summary

Functions

Functions

Link to this function

after_hundred(number, language_tag)

View Source
Link to this function

after_thousand_or_more(number, language_tag)

View Source
Link to this function

and_o(number, language_tag)

View Source
Link to this function

cents_f(number, language_tag)

View Source
Link to this function

cents_m(number, language_tag)

View Source
Link to this function

cents_o(number, language_tag)

View Source
Link to this function

commas(number, language_tag)

View Source
Link to this function

commas_o(number, language_tag)

View Source
Link to this function

et_un(number, language_tag)

View Source
Link to this function

et_une(number, language_tag)

View Source
Link to this function

et_unieme(number, language_tag)

View Source
Link to this function

fem_with_a(number, language_tag)

View Source
Link to this function

fem_with_i(number, language_tag)

View Source
Link to this function

fem_with_o(number, language_tag)

View Source
Link to this function

lenient_parse(number, language_tag)

View Source
Link to this function

mille_o(number, language_tag)

View Source
Link to this function

msc_no_final(number, language_tag)

View Source
Link to this function

msc_with_a(number, language_tag)

View Source
Link to this function

msc_with_a_nofinal(number, language_tag)

View Source
Link to this function

msc_with_i(number, language_tag)

View Source
Link to this function

msc_with_i_nofinal(number, language_tag)

View Source
Link to this function

msc_with_o(number, language_tag)

View Source
Link to this function

msc_with_o_nofinal(number, language_tag)

View Source
Link to this function

msco_with_a(number, language_tag)

View Source
Link to this function

msco_with_i(number, language_tag)

View Source
Link to this function

msco_with_o(number, language_tag)

View Source
Link to this function

ordinal_esima(number, language_tag)

View Source
Link to this function

ordinal_esima_with_a(number, language_tag)

View Source
Link to this function

ordinal_esima_with_i(number, language_tag)

View Source
Link to this function

ordinal_esima_with_o(number, language_tag)

View Source
Link to this function

ordinal_esime(number, language_tag)

View Source
Link to this function

ordinal_esime_with_a(number, language_tag)

View Source
Link to this function

ordinal_esime_with_i(number, language_tag)

View Source
Link to this function

ordinal_esime_with_o(number, language_tag)

View Source
Link to this function

ordinal_esimi(number, language_tag)

View Source
Link to this function

ordinal_esimi_with_a(number, language_tag)

View Source
Link to this function

ordinal_esimi_with_i(number, language_tag)

View Source
Link to this function

ordinal_esimi_with_o(number, language_tag)

View Source
Link to this function

ordinal_esimo(number, language_tag)

View Source
Link to this function

ordinal_esimo_with_a(number, language_tag)

View Source
Link to this function

ordinal_esimo_with_i(number, language_tag)

View Source
Link to this function

ordinal_esimo_with_o(number, language_tag)

View Source
Link to this function

r2d_year(number, language_tag)

View Source
Link to this function

rule_sets(rbnf_locale_name)

View Source
Link to this function

spellout_cardinal(number, locale)

View Source
Link to this function

spellout_cardinal_feminine(number, locale)

View Source
Link to this function

spellout_cardinal_feminine_cents(number, language_tag)

View Source
Link to this function

spellout_cardinal_masculine(number, locale)

View Source
Link to this function

spellout_cardinal_masculine_cents(number, language_tag)

View Source
Link to this function

spellout_cardinal_verbose(number, locale)

View Source
Link to this function

spellout_leading(number, language_tag)

View Source
Link to this function

spellout_numbering(number, locale)

View Source
Link to this function

spellout_numbering_cents(number, language_tag)

View Source
Link to this function

spellout_numbering_verbose(number, locale)

View Source
Link to this function

spellout_numbering_year(number, locale)

View Source
Link to this function

spellout_ordinal(number, locale)

View Source
Link to this function

spellout_ordinal_feminine(number, locale)

View Source
Link to this function

spellout_ordinal_feminine_cont(number, language_tag)

View Source
Link to this function

spellout_ordinal_feminine_conts(number, language_tag)

View Source
Link to this function

spellout_ordinal_feminine_plural(number, locale)

View Source
Link to this function

spellout_ordinal_masculine(number, locale)

View Source
Link to this function

spellout_ordinal_masculine_adjective(number, locale)

View Source
Link to this function

spellout_ordinal_masculine_cont(number, language_tag)

View Source
Link to this function

spellout_ordinal_masculine_conts(number, language_tag)

View Source
Link to this function

spellout_ordinal_masculine_plural(number, locale)

View Source
Link to this function

spellout_ordinal_verbose(number, locale)

View Source
Link to this function

subcents_f(number, language_tag)

View Source
Link to this function

subcents_m(number, language_tag)

View Source
Link to this function

subcents_o(number, language_tag)

View Source
Link to this function

teen(number, language_tag)

View Source
Link to this function

th(number, language_tag)

View Source
Link to this function

tieth(number, language_tag)

View Source
Link to this function

x_ty(number, language_tag)

View Source