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.
Summary
Functions
Transliterates digit characters in a string using a transliteration map.
Functions
Transliterates digit characters in a string using a transliteration map.
Non-digit characters (separators, signs, etc.) are passed through unchanged.
Arguments
stringis the string containing digits to transliterate.transliteration_mapis 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)
"١٢٣"