Lokalized JavaScript — Version 1.0.0
    Preparing search index...

    Function cardinalityForRange

    • Classify a range from its start and end cardinalities under the requested locale. For example, for English "1–2 books", pass CARDINALITY_ONE and CARDINALITY_OTHER.

      If the locale has cardinal rules but no CLDR range rule for this pair, the result is the end cardinality. A locale with no cardinal rules throws.

      Parameters

      • start: Cardinality

        the cardinality of the range's start value

      • end: Cardinality

        the cardinality of the range's end value

      • locale: string

        a BCP 47 locale tag. Malformed tags resolve to the undetermined locale; a non-string argument is rejected.

      Returns Cardinality

      one of the root's frozen CARDINALITY_* constants

      if an endpoint is not a CARDINALITY_* value, or the locale is not a string

      if the locale has no CLDR cardinal rules