# Fix Arabic numerals falling back to Latin digits

## TL;DR

The font or the formatter is not producing Arabic-Indic digits, so set the numbering system explicitly and check font coverage. Intl.NumberFormat with numberingSystem arab gives you Eastern Arabic digits, but only if the font has the glyphs. If the font lacks them, the browser falls back and you see Latin digits.

## The error

```text
Intl.NumberFormat('ar-EG') renders "123" instead of the Arabic-Indic digits
digits appear Latin in the Arabic UI
```

## Fix it

### Step 1: Check what the formatter actually produces

```bash
node -e "console.log(new Intl.NumberFormat('ar-EG').format(123), new Intl.NumberFormat('ar-EG-u-nu-arab').format(123))"
```

Expected: You see which numbering system each call uses.

### Step 2: Set the numbering system explicitly

```bash
node -e "console.log('use ar-EG-u-nu-arab or the numberingSystem option: arab for Eastern Arabic digits')"
```

Expected: The formatter is told exactly which digits to use.

### Step 3: Verify the font has the glyphs

```bash
node -e "console.log('render the digits in your UI font, missing glyphs show as boxes or fall back to another font')"
```

Expected: The digits render in the intended typeface.

### Step 4: Add a font with Arabic-Indic digits if needed

```bash
node -e "console.log('load a font covering U+0660..U+0669, or accept the system fallback deliberately')"
```

Expected: Digits render correctly everywhere.

## When to use this

- Arabic UI shows Latin digits where Arabic-Indic digits are expected
- Number formatting ignores the numbering system

## When NOT to use this

- You want Latin digits in an Arabic UI, that is a valid choice, set latn explicitly
- Digits are wrong in a non-Arabic locale, check the locale tag

## Tool and version compatibility

- Intl.NumberFormat, Unicode numbering systems
- ar-EG defaults vary by implementation, be explicit

## Variant phrasings

### Persian digits instead of Arabic

Use numberingSystem arabext for Extended Arabic-Indic digits used in Persian and Urdu.

### digits correct in Chrome but not Firefox

Font fallback chains differ. The explicit numbering system plus a covering font fixes both.

## Why it happens

The default numbering system for ar varies, and many web fonts lack the Arabic-Indic digit glyphs. When the glyph is missing the browser silently substitutes from another font, often one with Latin digits, so the number looks wrong.

## Edge cases

- Phone numbers and codes often stay Latin by convention, do not force arab there
- Input fields should accept both digit shapes, normalize on submit
- PDF rendering embeds fonts, missing glyphs there print as boxes not fallbacks

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_4L3rR9GInr5uenB0efK3Zw
