<inputname="q"type="text"class="search-input"placeholder="Search..."aria-label="Input your search terms"autocomplete="off"autocorrect="off"autocapitalize="off"spellcheck="false"/>
<p>Transliteration for digits and separators.</p><p>Transliterating a string is an expensive business. First the string has to
be exploded into its component graphemes. Then for each grapheme we have
to map to the equivalent in the other <codeclass="inline">{locale, number_system}</code>. Then we
have to reassemble the string.</p><p>Effort is made to short circuit where possible. Transliteration is not
required for any <codeclass="inline">{locale, number_system}</code> that is the same as <codeclass="inline">{"en", "latn"}</code> since the implementation uses this combination for the placeholders during
formatting already. When short circuiting is possible (typically the en-*
locales with "latn" number_system - the total number of short circuited
locales is 211 of the 537 in CLDR) the overall number formatting is twice as
fast than when formal transliteration is required.</p><h3id="module-configuring-precompilation-of-digit-transliterations"class="section-heading">
Configuring precompilation of digit transliterations
</h3>
<p>This module includes <ahref="https://hexdocs.pm/ex_cldr_numbers/2.30.1/Cldr.Number.Transliterate.html#transliterate_digits/3"><codeclass="inline">Cldr.Number.Transliterate.transliterate_digits/3</code></a> which transliterates
digits between number systems. For example from :arabic to :latn. Since generating a
transliteration map is slow, pairs of transliterations can be configured so that the
transliteration map is created at compile time and therefore speeding up transliteration at
run time.</p><p>To configure these transliteration pairs, add the to the <codeclass="inline">use Cldr</code> configuration
in a backend module:</p><pre><codeclass="makeup elixir"translate="no"><spanclass="kd">defmodule</span><spanclass="w"></span><spanclass="nc">MyApp.Cldr</span><spanclass="w"></span><spanclass="k"data-group-id="5502307860-1">do</span><spanclass="w">
</span><spanclass="k"data-group-id="5502307860-1">end</span></code></pre><p>Where each tuple in the list configures one transliteration map. In this example, two maps are
configured: from <codeclass="inline">:latn</code> to <codeclass="inline">:thai</code> and from <codeclass="inline">:arab</code> to <codeclass="inline">:thai</code>.</p><p>A list of configurable number systems is returned by <ahref="https://hexdocs.pm/ex_cldr_numbers/2.30.1/Cldr.Number.System.html#systems_with_digits/0"><codeclass="inline">Cldr.Number.System.systems_with_digits/0</code></a>.</p><p>If a transliteration is requested between two number pairs that have not been configured for
<ul><li><p><codeclass="inline">sequence</code> is the string to be transliterated.</p></li><li><p><codeclass="inline">locale</code> is any known locale, defaulting to <ahref="Plausible.Cldr.html#get_locale/0"><codeclass="inline">Plausible.Cldr.get_locale/0</code></a>.</p></li><li><p><codeclass="inline">number_system</code> is any known number system. If expressed as a <codeclass="inline">string</code> it
is the actual name of a known number system. If epressed as an <codeclass="inline">atom</code> it is
used as a key to look up a number system for the locale (the usual keys are
<codeclass="inline">:default</code> and <codeclass="inline">:native</code> but :traditional and :finance are also part of the
standard). See <ahref="Plausible.Cldr.Number.System.html#number_systems_for/1"><codeclass="inline">Plausible.Cldr.Number.System.number_systems_for/1</code></a> for a locale to
see what number system types are defined. The default is <codeclass="inline">:default</code>.</p></li></ul><p>For available number systems see <ahref="https://hexdocs.pm/ex_cldr_numbers/2.30.1/Cldr.Number.System.html#number_systems/0"><codeclass="inline">Cldr.Number.System.number_systems/0</code></a>
and <ahref="Plausible.Cldr.Number.System.html#number_systems_for/1"><codeclass="inline">Plausible.Cldr.Number.System.number_systems_for/1</code></a>. Also see
</span><spanclass="gp unselectable">iex></span><spanclass="nc">Plausible.Cldr.Number.Transliterate</span><spanclass="o">.</span><spanclass="n">transliterate</span><spanclass="p"data-group-id="9625894098-6">(</span><spanclass="s">"Some number is: 123556"</span><spanclass="p">,</span><spanclass="w"></span><spanclass="s">"th"</span><spanclass="p">,</span><spanclass="w"></span><spanclass="s">"thai"</span><spanclass="p"data-group-id="9625894098-6">)</span><spanclass="w">
<p>Transliterates digits from one number system to another number system</p><ul><li><p><codeclass="inline">digits</code> is binary representation of a number</p></li><li><p><codeclass="inline">from_system</code> and <codeclass="inline">to_system</code> are number system names in atom form. See
<ahref="https://hexdocs.pm/ex_cldr_numbers/2.30.1/Cldr.Number.System.html#systems_with_digits/0"><codeclass="inline">Cldr.Number.System.systems_with_digits/0</code></a> for available number systems.</p></li></ul><h2id="transliterate_digits/3-example"class="section-heading">