Definition
- Eastern Arabic numerals are the digits
٠١٢٣٤٥٦٧٨٩, which Unicode names Arabic-Indic digits (U+0660toU+0669). The W3C's Arabic Layout Requirements list them for eastern Arabic-speaking countries such as Egypt, Saudi Arabia and Iraq, and the European digits0123456789for western ones such as Algeria and Morocco. - The name is ambiguous: it also covers the Persian and Urdu forms
۰۱۲۳۴۵۶۷۸۹, Unicode's Extended or Eastern Arabic-Indic digits (U+06F0toU+06F9), whose four, five and six differ in shape. The W3C avoids it for that reason; here, as in Arablyzer's rules, it means٠to٩. - In every system, the highest digit is on the left, even in right-to-left text. Arabic-Indic digits have their own separators,
٫and٬, as in١٬٢٣٤٫٥.
Why it matters
- Mixing systems on one page,
15here and١٥there, looks careless, and search treats them as different text. - In a form's pattern,
\dand[0-9]match Western digits only, so a phone number typed in Arabic-Indic digits can be refused. - The Unicode Bidirectional Algorithm gives Arabic-Indic digits their own type (AN) and European and Persian digits another (EN), so a sentence can order differently with each.
Example
Name the digit system when you format a number:
js
new Intl.NumberFormat('ar-u-nu-arab').format(1500.5) // '١٬٥٠٠٫٥'
new Intl.NumberFormat('ar-u-nu-latn').format(1500.5) // '1,500.5'nu sets the numbering system: arab for Arabic-Indic, arabext for Persian and latn for Western digits. Without it, the default depends on the locale.
Common mistakes
- Letting each source choose its digits: prices from the database in one system, dates from a plugin in another.
- Persian digits in Arabic text:
۴,۵and۶differ from٤,٥and٦, and usually come from a Persian keyboard or source. - Validating with
\dor[0-9]alone: accept the digits people type, and convert them before checking.