Cldr v0.0.5 Cldr.Number.Ordinal

Manages the rules for ordinal numbers.

Summary

Functions

The configured locales for which plural rules are defined

The locales for which cardinal rules are defined

Lookup the plural cardinal category for a given number in a given locale

The plural rules defined in CLDR

Return the plural rules for a locale

Types

operand()
operand :: non_neg_integer

Functions

configured_locales()

The configured locales for which plural rules are defined

This is the intersection of the Cldr.known_locales and the locales for which plural rules are defined. There are many Cldr locales which don’t have their own plural rules so this list is the intersection of Cldr’s configured locales and those that have rules.

known_locales()

The locales for which cardinal rules are defined

plural_rule(number, locale \\ Cldr.get_locale(), rounding \\ Cldr.Number.Math.default_rounding())

Lookup the plural cardinal category for a given number in a given locale

Identify which category (zero, one, two, few, many or other) a given number in a given locale fits into. This category can then be used to format the number or currency

plural_rules()
plural_rules :: Map.t

The plural rules defined in CLDR.

plural_rules_for(locale)
plural_rules_for(Cldr.locale) :: %{}

Return the plural rules for a locale.

The rules are returned in AST form after parsing.