Skip to main content

The und Locale

The und locale (BCP 47 for "undetermined" — the CLDR root locale) is unlike all other 88 locales in this library. Rather than spelling numbers out in a natural language, it provides historic and non-Latin numeral systems alongside plain numeric fallbacks.

Use it to convert numbers into Roman, Greek, Hebrew, Armenian, Cyrillic, Ethiopic, Georgian, or Tamil numerals.

import { RuleBasedNumberFormat } from "@pointnet/cldr-spellout";

const und = RuleBasedNumberFormat.fromLocale("und");

und.format(42, "%roman-upper"); // "XLII"
und.format(42, "%greek-lower"); // "μβ´"
und.format(42, "%hebrew"); // "מ״ב"
und.format(42, "%ethiopic"); // "፵፪"
und.format(42, "%tamil"); // "௪௰௨"

Historic numeral systems

Rule setScript110421001000
%roman-lowerRoman (lowercase)ixxliicm
%roman-upperRoman (uppercase)IXXLIICM
%greek-lowerGreek (lowercase)α´ι´μβ´ρ´͵α´
%greek-upperGreek (uppercase)Α´Ι´ΜΒ´Ρ´͵Α´
%armenian-lowerArmenian (lowercase)աժխբճռ
%armenian-upperArmenian (uppercase)ԱԺԽԲՃՌ
%cyrillic-lowerCyrillic numeralsа҃і҃м҃вр҃҂а҃
%ethiopicEthiopic፵፪፲፻
%georgianGeorgianმბ
%hebrewHebrew (with punctuation)א׳י׳מ״בק׳אלף
%hebrew-itemHebrew (bare, no geresh)אימבקתתר
%tamilTamil௪௰௨
Range limits

Numbers beyond a system's historical range fall back to decimal digits. For example, Roman numerals fall back above 3,999; Armenian and Georgian above 9,999.

Numeric fallbacks

The remaining rule sets produce formatted decimal digits rather than a different numeral script. They are useful when you need a consistent API regardless of locale but still want the standard CLDR rule-set names.

Rule setDescriptionExample (3,662)
%spellout-numberingComma-formatted digits3,662
%spellout-cardinalSame as %spellout-numbering3,662
%spellout-ordinalDigits with trailing period3,662.
%digits-ordinalDigits with trailing period3,662.
%spellout-numbering-yearPlain digits, no thousands separator3662
%zz-defaultComma-formatted digits3,662

Full example

import { RuleBasedNumberFormat } from "@pointnet/cldr-spellout";

const und = RuleBasedNumberFormat.fromLocale("und");
const year = 2024;

console.log(und.format(year, "%roman-upper")); // "MMXXIV"
console.log(und.format(year, "%greek-upper")); // "͵ΒΚΔ´"
console.log(und.format(year, "%armenian-upper")); // "ՍԻԴ"
console.log(und.format(year, "%hebrew")); // "ב׳כ״ד"
console.log(und.format(year, "%ethiopic")); // "፳፻፳፬"