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 set | Script | 1 | 10 | 42 | 100 | 1000 |
|---|---|---|---|---|---|---|
%roman-lower | Roman (lowercase) | i | x | xlii | c | m |
%roman-upper | Roman (uppercase) | I | X | XLII | C | M |
%greek-lower | Greek (lowercase) | α´ | ι´ | μβ´ | ρ´ | ͵α´ |
%greek-upper | Greek (uppercase) | Α´ | Ι´ | ΜΒ´ | Ρ´ | ͵Α´ |
%armenian-lower | Armenian (lowercase) | ա | ժ | խբ | ճ | ռ |
%armenian-upper | Armenian (uppercase) | Ա | Ժ | ԽԲ | Ճ | Ռ |
%cyrillic-lower | Cyrillic numerals | а҃ | і҃ | м҃в | р҃ | ҂а҃ |
%ethiopic | Ethiopic | ፩ | ፲ | ፵፪ | ፻ |