Cldr.Rbnf (Cldr Numbers v2.22.1) View Source

Functions to implement Rules Based Number Formatting (rbnf)

During compilation RBNF rules are extracted and generated as function bodies by Cldr.Rbnf.Ordinal, Cldr.Rbnf.Cardinal and Cldr.Rbnf.NumberSystem.

The functions in this module would not normally be of common use outside of supporting the compilation phase.

Link to this section Summary

Functions

Returns {:ok, rbnf_rules} for a locale or {:error, {Cldr.NoRbnf, info}}

Returns {:ok, rbnf_rules} for a locale or {:error, {Cldr.NoRbnf, info}}

Returns rbnf_rules for a locale or raises an exception if there are no rules.

Returns rbnf_rules for a locale and backend or raises an exception if there are no rules.

Returns the list of locales that that have RBNF defined

Link to this section Functions

Link to this function

categories_for_locale!(locale)

View Source
Link to this function

for_locale(language_tag)

View Source

Specs

for_locale(Cldr.LanguageTag.t()) ::
  {:ok, map()} | {:error, {module(), String.t()}}

Returns {:ok, rbnf_rules} for a locale or {:error, {Cldr.NoRbnf, info}}

  • locale is any t:Cldr.LanguageTag
Link to this function

for_locale(locale, backend)

View Source

Specs

for_locale(Cldr.Locale.locale_name() | Cldr.LanguageTag.t(), Cldr.backend()) ::
  {:ok, map()} | {:error, {module(), String.t()}}

Returns {:ok, rbnf_rules} for a locale or {:error, {Cldr.NoRbnf, info}}

Returns rbnf_rules for a locale or raises an exception if there are no rules.

  • locale is any Cldr.LanguageTag

  • backend is any module that includes use Cldr and therefore is a Cldr backend module

Link to this function

for_locale!(locale, backend)

View Source

Returns rbnf_rules for a locale and backend or raises an exception if there are no rules.

Link to this function

known_locale_names(backend)

View Source

Returns the list of locales that that have RBNF defined

This list is the set of known locales for which there are rbnf rules defined.

Link to this function

rbnf_locale_error(locale_name)

View Source
Link to this function

rbnf_rule_error(language_tag, format)

View Source