Cldr.Number.Transliterate.transliterate

You're seeing just the function transliterate, go back to Cldr.Number.Transliterate module for more information.
Link to this function

transliterate(sequence, locale, number_system, backend)

View Source

Transliterates from latin digits to another number system's digits.

Transliterates the latin digits 0..9 to their equivalents in another number system. Also transliterates the decimal and grouping separators as well as the plus, minus and exponent symbols. Any other character in the string will be returned "as is".

  • sequence is the string to be transliterated.

  • locale is any known locale, defaulting to Cldr.get_locale/0.

  • number_system is any known number system. If expressed as a string it is the actual name of a known number system. If epressed as an atom it is used as a key to look up a number system for the locale (the usual keys are :default and :native but :traditional and :finance are also part of the standard). See Cldr.Number.System.number_systems_for/2 for a locale to see what number system types are defined. The default is :default.

For available number systems see Cldr.Number.System.number_systems/0 and Cldr.Number.System.number_systems_for/2. Also see Cldr.Number.Symbol.number_symbols_for/2.

Examples

iex> Cldr.Number.Transliterate.transliterate("123556", "en", :default, TestBackend.Cldr)
"123556"

iex> Cldr.Number.Transliterate.transliterate("123,556.000", "fr", :default, TestBackend.Cldr)
"123 556,000"

iex> Cldr.Number.Transliterate.transliterate("123556", "th", :default, TestBackend.Cldr)
"123556"

iex> Cldr.Number.Transliterate.transliterate("123556", "th", "thai", TestBackend.Cldr)
"๑๒๓๕๕๖"

iex> Cldr.Number.Transliterate.transliterate("123556", "th", :native, TestBackend.Cldr)
"๑๒๓๕๕๖"

iex> Cldr.Number.Transliterate.transliterate("Some number is: 123556", "th", "thai", TestBackend.Cldr)
"Some number is: ๑๒๓๕๕๖"