# `Localize.Number.Transliterate`
[🔗](https://github.com/elixir-localize/localize/blob/v0.39.0/lib/localize/number/transliterate.ex#L1)

Functions to transliterate digits between number systems.

Transliteration replaces each digit character in a string with
the corresponding digit from another number system using a
precomputed mapping.

# `transliterate_digits`

```elixir
@spec transliterate_digits(String.t(), map()) :: String.t()
```

Transliterates digit characters in a string using a
transliteration map.

Non-digit characters (separators, signs, etc.) are passed
through unchanged.

### Arguments

* `string` is the string containing digits to transliterate.

* `transliteration_map` is a map of `%{from_grapheme => to_grapheme}`.

### Returns

* A new string with digits replaced according to the map.

### Examples

    iex> map = %{"0" => "٠", "1" => "١", "2" => "٢", "3" => "٣"}
    iex> Localize.Number.Transliterate.transliterate_digits("123", map)
    "١٢٣"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
