Changelog
View SourceCldr Numbers v2.35.2
This is the changelog for Cldr v2.35.2 released on September 10th, 2025. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes stray doc backtick. Thanks to @Munksgaard. Closes #56.
Cldr Numbers v2.35.1
This is the changelog for Cldr v2.35.1 released on April 23rd, 2025. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix formatting currency amounts when the currency format does not have a digit placeholder (0and#) directly next to the currency placeholder (¤). Thanks to @benregn for the report. Closes #54.
Cldr Numbers v2.35.0
This is the changelog for Cldr v2.35.0 released on March 26th, 2025. For older changelogs please consult the release tag on GitHub
Breaking changes
- The new OTP 28 re module is largely - but not completely - compatible with the version on OTP 27 and earlier. One of the noted differences during testing is that on OTP 27, the bitcoin symbol ₿is not part of the set of Unicode symbols (categorySc). In OTP 28 it is. Therefore there may be minor differences in how numbers and money with the currency bitcoin are formatted. During testing, these were the only test failures detected between OTP 27 and OTP 28.
Bug Fixes
- Support Elixir 1.19 and OTP 28 without errors or warnings. Primarily this relates to changes to OTP's new :re module and Elixir's evolving type system.
Cldr Numbers v2.34.1
This is the changelog for Cldr v2.34.1 released on March 22nd, 2025. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix compilation failures related to compile-time nested alias issues. Thanks to @TimisRobert for the issues. Closes ex_cldr #256.
Cldr Numbers v2.34.0
This is the changelog for Cldr v2.34.0 released on March 18th, 2025. For older changelogs please consult the release tag on GitHub
Enhancements
- Updates to CLDR 47 data. 
- Adds - :separatorsoption to- Cldr.Number.to_string/2,- Cldr.Number.Parser.parse/2and- Cldr.Number.Parser.scan/2. This option is for selecting from the available alternative grouping and decimal separators. The default is- separators: :standardwhich is avaialble for all locales and number systems that have separators. Some locales, for example- en-ZA, may have an alternative set of separators. In the case of- en-ZA, the alternative is- separators: :us.
- Adds - :number_systemas an option to- Cldr.Number.Parser.parse/2.
Cldr Numbers v2.33.6
This is the changelog for Cldr v2.33.6 released on February 13th, 2025. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Document currency_symbol: :none. This option formats a currency amount using a format that does not include a currency symbol.
Cldr Numbers v2.33.5
This is the changelog for Cldr v2.33.5 released on January 26th, 2025. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix formatting currencies when the CLDR regex for "before currency match" is invalid in the Erlang regex engine. Thanks to @Terbium-135 for the issue. Closes ex_money issue #178.
Cldr Numbers v2.33.4
This is the changelog for Cldr v2.33.4 released on November 13th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes unquoting invalid AST on the upcoming Elixir 1.18. Thanks very much to @sabiwara for the PR. Thanks too to @SteffenDE for the report. Closes #53.
Cldr Numbers v2.33.3
This is the changelog for Cldr v2.33.3 released on August 16th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix specs to suport dialyzer flags :error_handling, :unknown, :underspecs, :extra_return, :missing_return
Cldr Numbers v2.33.2
This is the changelog for Cldr v2.33.2 released on July 30th, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix spec for all_formats_for!/3. Thanks to @@AntoineAugusti for the report. Closes #50.
Cldr Numbers v2.33.1
This is the changelog for Cldr v2.33.1 released on April 23rd, 2024. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Add config/prod.exssoMIX_ENV=prodcompilation succeeds. Thanks to @camelpunch for the report. Closes #49.
Cldr Numbers v2.33.0
This is the changelog for Cldr v2.33.0 released on April 21st, 2024. For older changelogs please consult the release tag on GitHub
Enhancements
- Update to CLDR 45.0 data. 
- Support currency formatting when the given currency in a given locale uses a specific symbol that replaces the decimal separator. The only known example is the Cape Verde escudo. A formatted example formatting 20 CVE is - 20$00.
Cldr Numbers v2.32.4
This is the changelog for Cldr v2.32.4 released on January 18th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix formatting a number when a currency is specified but the format has no currency symbol. Closes ex_money 162.
Cldr Numbers v2.32.3
This is the changelog for Cldr v2.32.3 released on November 2nd, 2023. For older changelogs please consult the release tag on GitHub
- Fix formatting a number when a currency is specified but the format has no currency symbol. Closes ex_money 162.
Cldr Numbers v2.32.3
This is the changelog for Cldr v2.32.0 released on November 2nd, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix compiler warnings on Elixir 1.16. 
- Fix return spec for - Cldr.Number.to_string/2. Thanks to @Munksgaard for the PR. Closes #45.
Cldr Numbers v2.32.2
This is the changelog for Cldr v2.32.0 released on September 12th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes RBNF rules for fractions. Previous the rule :spellout_cardinalwas being used to format the fractional part of a number. However this rule is not defined for many locales. This is changed to:spellout_numberingwhich is available in all known locales.
Cldr Numbers v2.32.1
This is the changelog for Cldr v2.32.0 released on September 9th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Use currency default fractional digits for currency formats if no :fractional_digitsoption is provided. Thanks to @dhedlund for the report. This reverts that change made in 2.31.3 which was described as "Don't override currency fractional digits when formatting a number. The format should always define the fractional digits unless overriden by the:fractional_digitsoption." Fractional digits will also be set to the currency definition of digits unless overriden.
Cldr Numbers v2.32.0
This is the changelog for Cldr v2.32.0 released on September 4th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix formatting numbers with format - :standardwhen the standard format is an RBNF rule.
- Fix formatting numbers with an RBNF format that is defined on locale - :undeven when the formatting locale doesn't have an- :rbnf_locale_name.
- Improve several error messages around number systems and RBNF rules. 
Deprecations
- Cldr.Number.System.systems_with_digits/0is deprecated in favour of- Cldr.Number.System.numeric_systems/0.
Enhancements
- Adds - Cldr.Number.System.algorithmic_systems/0which is the counterpoint to- Cldr.Number.System.numeric_systems/0.
- Functions in the - Cldr.Number.Formatmodule now default the- backendargument to be- Cldr.default_backend!/0.
Cldr Numbers v2.31.3
This is the changelog for Cldr v2.31.3 released on July 24th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Support - format: :scientificwhich is documented but was not implemented as a valid option. Thanks to @petrus-jvrensburg for the report. Closes #38.
- Don't override currency fractional digits when formatting a number. The format should always define the fractional digits unless overriden by the - :fractional_digitsoption.
Cldr Numbers v2.31.2
This is the changelog for Cldr v2.31.2 released on July 7th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes formatting of numbers in locales where the locale has no RBNF. Thanks to @petrus-jvrensburg for the report. Closes #37.
Cldr Numbers v2.31.1
This is the changelog for Cldr v2.31.1 released on May 17th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Ensure all RBNF rule names are valid function names. In at least one case ("2d_year") a rule name does not map to a valid Elixir function name.  The rules are built with atom function names which is valid, but the string versions of that name do not parse. MyApp.Cldr.Rbnf.Spellout.2d_year/2does not parse, evening though the function exists. This can cause interoperabiity issues with other libraries the introspect code, likeinch_ex. From this release, rule names are forced to be valid, parseable function names by prepending an "r" to the rule name if the rule name starts with a digit. Thanks to @ggarciajr for the report.
Cldr Numbers v2.31.0
This is the changelog for Cldr v2.31.0 released on April 28th, 2023. For older changelogs please consult the release tag on GitHub
Enhancements
- Updates to ex_cldr version 2.37.0 which includes data from CLDR release 43 
- Support a - :wrapperfunction to return- iodatawhen used as an option to- Cldr.Number.to_string/2.
Cldr Numbers v2.30.1
This is the changelog for Cldr v2.30.1 released on March 28th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes currency formats where the currency symbol is neither the first or last token. Thanks to @simoncocking for the issue. Closes #35.
Cldr Numbers v2.30.0
This is the changelog for Cldr v2.30.0 released on March 7th, 2023. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix short formatting for decimal numbers. Thanks to @dbernheisel for the report. Closes #34. 
- Fix formatting negative numbers when the currency symbol results in an alphabetic character next to the number. In these cases a special format - :currency_alpha_next_to_number(or- :accounting_alpha_next_to_number) is used. These formats are only available in CLDR42 or later and therefore- ex_cldrversion 2.35.0 or later is required.
- Specifies Elixir 1.11 or later in alignment with the requirements for - ex_cldr.
Enhancements
- Supports the - :default_currency_formatbackend configuration option introduced in- ex_cldrversion 2.35.0.
- Adds - :from_localeas a valid value to the- :currencyoption to- Cldr.Number.to_string/3. If set, the currency is derived from the locale.
Cldr_Numbers v2.29.0
This is the changelog for Cldr v2.29.0 released on January 17th, 2023. For older changelogs please consult the release tag on GitHub
Behavior change
- In prior releases formatting a number as - format: :currencywould derive the currency code from the locale if no- :currencywas provided. This is no longer the case. As of CLDR42 a format- :currency_no_symbolis defined to allow formatting of the number without an associated symbol. Now when- format: :currencyis passed without a- :currencyoption, the format is changed to- format: :currency_no_symbol. To retain the existing behaviour, pass- currency: Cldr.Currency.currency_from_locale(locale)as an option.
- In prior releases the currency format (:currency or :accounting) would be overriden by any choice expressed in the locale. That is no longer the case from this release. To retain the existing behaviour, pass - format: Cldr.Currency.currency_format_from_locale(locale)as an option.
Enhancements
- Adds an option - :wrapperto- Cldr.Number.to_string/2. The argument is a 2-arity function that receives the parameters- stringand- tagwhere- tagis one of- :number,- :currency_symbol,- :currency_space,- :literal,- :quote,- :percent,- :permille,- :minusor- :plus. The function must return a string or a "safe string" such as that returned by- Phoenix.HTML.Tag.content_tag/3. The function can be used to wrap format elements in HTML or other tags. Thanks to @rubas for the motivation and review. Example:- iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn ...> string, :currency_symbol -> "<span class=\"symbol\">" <> string <> "</span>" ...> string, :number -> "<span class=\"number\">" <> string <> "</span>" ...> string, :currency_space -> "<span>" <> string <> "</span>" ...> string, _other -> string ...> end) {:ok, "<span class=\"symbol\">$</span><span class=\"number\">100.00</span>"} # It is also possible and recommended to use the `Phoenix.HTML.Tag.content_tag/3` # function if wrapping HTML tags since these will ensure HTML entities are # correctly encoded. For example: iex> Cldr.Number.to_string(100, format: :currency, currency: :USD, wrapper: fn ...> string, :currency_symbol -> Phoenix.HTML.Tag.content_tag(:span, string, class: "symbol") ...> string, :number -> Phoenix.HTML.Tag.content_tag(:span, string, class: "number") ...> string, :currency_space -> Phoenix.HTML.Tag.content_tag(:span, string) ...> string, _other -> string ...> end) {:ok, "<span class=\"symbol\">$</span><span class=\"number\">100.00</span>"}
- Adds the number formats - :currency_no_symboland- :accounting_no_symbolthat can be used to format currency amounts without an associated currency symbol.
- Removes the - Cldr.Number.to_string/3requirement for a currency to be provided (or derived) when the format is- :currency. If a currency is provided, the format- :currencyis used. If a currency is not provided, the format- :currency_no_symbolis used.
Cldr_Numbers v2.28.0
This is the changelog for Cldr v2.28.0 released on October 24th, 2022. For older changelogs please consult the release tag on GitHub
Enhancements
- Encapsulates CLDR 42 data. Unless otherwise noted, all the changes are reflected in ex_cldrlibraries and functions.
Cldr_Numbers v2.27.3
This is the changelog for Cldr v2.27.3 released on October 8th, 2022. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Cldr.Number.to_string/3with- format: :narrowand- :currencyset will use the currency's narrow symbol.
- Apply currency spacing for short formats (previously not being applied) 
Cldr_Numbers v2.27.2
This is the changelog for Cldr v2.27.2 released on July 21st, 2022. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix :shortformatting of decimal numbers with specified fractional digits. Thanks to @glennr for the report. Closes #32.
Cldr_Numbers v2.27.1
This is the changelog for Cldr v2.27.1 released on July 20th, 2022. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix :shortformatting of negative numbers. Thanks to @glennr for the report. Closes #30.
Cldr_Numbers v2.27.0
This is the changelog for Cldr v2.27.0 released on May 14th, 2022. For older changelogs please consult the release tag on GitHub
Enhancements
- Add support for formatting numbers representing ISO 24165 Digital Tokens (aka crypto currencies). The behaviour follows that for currency formatting. Given that the digital token registry does not contain fraction precision data or pluralised or localised token names, the formatting of digital tokens amounts is not localized beyond formatting the number itself.
Cldr_Numbers v2.26.0
This is the changelog for Cldr v2.26.0 released on April 6th, 2022. For older changelogs please consult the release tag on GitHub
Enhancements
- Update CLDR to release 41 in ex_cldr version 2.28.0
Cldr_Numbers v2.25.2
This is the changelog for Cldr v2.25.1 released on March 2nd, 2022. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes formatting of DecimalInfandNaNnumbers. Thanks to @sh41 for the report. Closes #26.
Cldr_Numbers v2.25.1
This is the changelog for Cldr v2.25.1 released on February 22nd, 2022. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Remove compiler warnings on Elixir 1.11. Thanks to @koszta for the report. Fixes #24. 
- Remove spurious - @dialyzerdirectives that are no longer required (because we understand dialyzer a little bit more now).
Cldr_Numbers v2.25.0
This is the changelog for Cldr v2.25.0 released on February 21st, 2022. For older changelogs please consult the release tag on GitHub
Enhancements
- Updates to ex_cldr version 2.26.0 which uses atoms for locale names and rbnf locale names. This is consistent with out elements of t:Cldr.LanguageTagwhere atoms are used where the cardinality of the data is fixed and relatively small and strings where the data is free format.
Cldr_Numbers v2.24.0
This is the changelog for Cldr v2.24.0 released on December 30th, 2021. For older changelogs please consult the release tag on GitHub
Enhancements
- Allowed limited forms of format composition. For example, composing a - :longformat with a- :currencyformat:- iex> Cldr.Number.to_string!(100_000_000, format: :long) |> Cldr.Number.to_string(format: :currency) {:ok, "$100 million"}
- Add format - :currency_long_with_symbolwhich is a composite of- :currency_longand the locales standard currency format. This supports formatting of of numbers like "$100 million" in the example above.
Cldr_Numbers v2.23.3
This is the changelog for Cldr v2.23.3 released on December 14th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes short formatting for decimal numbers. Thanks to @datrader for the report. Closes #135 on ex_money.
Cldr_Numbers v2.23.2
This is the changelog for Cldr v2.23.2 released on December 3rd, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes Cldr.Number.Parser.resolve_currencies/1when the argument is whitespace only. Thanks to @datrader for the report.
Cldr_Numbers v2.23.1
This is the changelog for Cldr v2.23.1 released on December 1st, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Replace - use Mix.Configwith- import Configin config files
- Fix typespec for - <backend>.Cldr.Number.Transliterate.transliterate_digits/3
Cldr_Numbers v2.23.0
This is the changelog for Cldr v2.23.0 released on October 27th, 2021. For older changelogs please consult the release tag on GitHub
Enhancements
- Updates to support CLDR release 40 via ex_cldr version 2.24 
- Adds - Cldr.Rbnf.rule_names_for_locale/1to return the available RBNF rule names for a given locale.
Bug Fixes
- Arbitrary RBNF rule lookup falls back to the root locale (called "und") when checking if a rule is available. Thanks to @maennchen for the report. Closes #22. 
- Fixes performance issue when calling - Cldr.Number.to_string/3with an arbitrary RBNF rule name. Previously these formats would mistakenly read the raw json file for a locale incurring a significant performance penaly. Performance is now 100x faster as expected. Thanks to @maennchen for the bug report. Closes #21.
Deprecations
- Don't call deprecated - Cldr.Config.known_locale_names/1, call- Cldr.Locale.Loader.known_locale_names/1instead.
- Don't call deprecated - Cldr.Config.get_locale/2, use- Cldr.Locale.Loader.get_locale/2instead.
Cldr_Numbers v2.23.0-rc.4
This is the changelog for Cldr v2.23.0-rc.4 released on October 26th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Arbitrary RBNF rule lookup falls back to the root locale (called "und") when checking if a rule is available. Thanks to @maennchen for the report. Closes #22.
Cldr_Numbers v2.23.0-rc.3
This is the changelog for Cldr v2.23.0-rc.3 released on October 25th, 2021. For older changelogs please consult the release tag on GitHub
Deprecations
- Don't call deprecated Cldr.Config.known_locale_names/1, callCldr.Locale.Loader.known_locale_names/1instead.
Cldr_Numbers v2.23.0-rc.2
This is the changelog for Cldr v2.23.0-rc.2 released on October 24th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Don't call deprecated Cldr.Config.get_locale/2, useCldr.Locale.Loader.get_locale/2instead.
Cldr_Numbers v2.23.0-rc.1
This is the changelog for Cldr v2.23.0-rc.1 released on October 24th, 2021. For older changelogs please consult the release tag on GitHub
Enhancements
- Adds Cldr.Rbnf.rule_names_for_locale/1to return the available RBNF rule names for a given locale.
Bug Fixes
- Fixes performance issue when calling Cldr.Number.to_string/3with an arbitrary RBNF rule name. Previously these formats would mistakenly read the raw json file for a locale incurring a significant performance penaly. Performance is now 100x faster as expected. Thanks to @maennchen for the bug report. Closes #21.
Cldr_Numbers v2.23.0-rc.0
This is the changelog for Cldr v2.23.0-rc.0 released on October 3rd, 2021. For older changelogs please consult the release tag on GitHub
Enhancements
- Updates to support CLDR release 40
Cldr_Numbers v2.22.1
This is the changelog for Cldr v2.22.1 released on September 13th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Return the remainder strings with casing preserved when resolving currencies and pers in Cldr.Numbers.Parser.
Cldr_Numbers v2.22.0
This is the changelog for Cldr v2.22.0 released on August 22nd, 2021. For older changelogs please consult the release tag on GitHub
Enhancements
- Cldr.Number.Parser.resolve_currencies/2and- Cldr.Number.Parser.resolve_per/2only perform replacements if the the found string is not adjacent to an alphabetic character.
- Cldr.Number.Parser.resolve/2and- Cldr.Number.Parser.find_and_replace/2are made public functions.
- Add - resolve_pers/2and- resolve_per/2to the- MyApp.Numbermodule.
Cldr_Numbers v2.21.0
This is the changelog for Cldr v2.21.0 released on August 18th, 2021. For older changelogs please consult the release tag on GitHub
Enhancements
- Add Cldr.Number.Parser.resolve_pers/2which will tokenize percent and permille symbols into:percentand:permille. This is similar to theCldr.Number.Parser.resolve_currencies/2function but for percent and permille symbols. An example is:
iex> Cldr.Number.Parser.scan("100%")
...> |> Cldr.Number.Parser.resolve_pers()
[100, :percent]Cldr_Numbers v2.20.0
This is the changelog for Cldr v2.20.0 released on August 17th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Improve number parsing with Cldr.Number.Parser.scan/2when the string has lists of numbers separated by commas. Thanks to @DaTrader for the report. Closes #19.
Enhancements
- Add support for custom currency symbols. This extends the use of the :currency_symboloption. In previously releases this option was required to be:standardor:iso. Now the value can also be:narrow,:symbolor a string which will be used as the currency symbol. From the documentation forCldr.Number.to_string/3:- currency_symbol: Allows overriding a currency symbol. The alternatives are:- :isothe ISO currency code will be used instead of the default currency symbol.
- :narrowuses the narrow symbol defined for the locale. The same narrow symbol can be defined for more than one currency and therefore this should be used with care. If no narrow symbol is defined, the standard symbol is used.
- :symboluses the standard symbol defined in CLDR. A symbol is unique for each currency and can be safely used.
- "string" uses stringas the currency symbol
- :standard(the default and recommended) uses the CLDR-defined symbol based upon the currency format for the locale.
 
 
Cldr_Numbers v2.19.0
This is the changelog for Cldr v2.19.0 released on July 1st, 2021. For older changelogs please consult the release tag on GitHub
Enhancements
- Updated to ex_cldr version 2.23.0 which changes the names of some of the field in the "-u-" extension to match the CLDR canonical name. In particular the field name number_systemchanges tonumbers.
Cldr_Numbers v2.18.4
This is the changelog for Cldr v2.18.4 released on June 17th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Allow t:Cldr.Currencyas a:currencyoption inCldr.Number.to_string/2. Thanks to @jeroenvisser101 for the PR.
Cldr_Numbers v2.18.3
This is the changelog for Cldr v2.18.3 released on June 12th, 2021. For older changelogs please consult the release tag on GitHub
Breaking Change
- There is a minor breaking change in the error return from Cldr.Number.Parser.parse/2. Previously the error return was{:error, string}. It is now more consistent with the rest ofex_cldrand returns{:error, {exception, message}}
Bug Fixes
- Fix Cldr.Number.Parser.parse/2for numbers that are in non-latin scripts (like Thai, Arabic, ...). There are 66 known number systems that have decimal digits as of CLDR39.
Cldr_Numbers v2.18.2
This is the changelog for Cldr v2.18.2 released on June 11th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix Cldr.Number.Parser.scan/2to correctly parse numbers like1kg
Cldr_Numbers v2.18.1
This is the changelog for Cldr v2.18.1 released on June 8th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
Thanks to @alaadahmed for the collaboration to fix two bugs in rules based number formatting.
- Fixes RBNF formatting options setting for - :spellout_ordinal
- Allows any defined RNBF rule for a locale to be invoked as the - :formatoption to- Cldr.Number.to_string/3.
Cldr_Numbers v2.18.0
This is the changelog for Cldr v2.18.0 released on May 8th, 2021. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes short and long number formatting. 
- Fixes formatting whent the format string consists only of digits. Previously this would erroneously set both the maximum and minimum integer digits. Now it only sets the minimum integer digits. 
Enhancements
- Add option :maximum_integer_digitsas an option toCldr.Number.to_string/2
Cldr_Numbers v2.17.0
This is the changelog for Cldr v2.17.0 released on April 8th, 2021. For older changelogs please consult the release tag on GitHub
Enhancements
- Updated to require ex_cldr version 2.20 which includes CLDR 39 data.
Cldr_Numbers v2.16.1
This is the changelog for Cldr v2.16.1 released on November 8th, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix bug in Cldr.Number.System.number_system_from/1to correctly allow a binary language tag without a backend parameter (which will then default toCldr.default_backend!/0)
Cldr_Numbers v2.16.0
This is the changelog for Cldr v2.16.0 released on November 1st, 2020. For older changelogs please consult the release tag on GitHub
Enhancements
- Support CLDR 38 
- Add - Cldr.Number.Formatter.Short.short_format_exponent/2to support compact number pluralization that is added to CLDR 38 (for the "fr" locale only in this release)
Cldr_Numbers v2.15.4
This is the changelog for Cldr v2.15.4 released on Septmber 26th, 2020. For older changelogs please consult the release tag on GitHub
Enhancements
- Use Cldr.default_backend!/1when available sinceCldr.default_backend/0is deprecated as ofex_cldrversion2.18.0.
Bug Fixes
- Use - Cldr.Decimal.compare/2which works consistently with- Decimal- 1.xand- 2.x
- Apply compile-time detection of - Decimalversion in order to know the correct return type of- Decimal.parse/1which differs between- 1.xand- 2.x
Cldr_Numbers v2.15.3
This is the changelog for Cldr v2.15.3 released on September 5th, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix documentation referencing Cldr.known_locale_names/10to correctly referenceCldr.known_locale_names/0.
Cldr_Numbers v2.15.2
This is the changelog for Cldr v2.15.2 released on August 30th, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Removes dialyzer warning when running on Elixir 1.11.  Uses Logger.warning/2notLogger.warn/2in this case and uses an anonymous function not a string so that dialyzer is happy.
Cldr_Numbers v2.15.1
This is the changelog for Cldr v2.15.1 released on June 23rd, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes two number parsing bugs: - A bug whereby decimal and separator symbols would be impacted in non-number strings when using MyApp.Cldr.Number.scan/2
- A bug whereby numbers using various localised symbols would not be recognised
 
- A bug whereby decimal and separator symbols would be impacted in non-number strings when using 
- Fix formatter pipeline generation which was including the - round nearestpipeline stage even when not required. Thanks to @jeroenvisser101 for the collaboration. Fixes #14.
Cldr_Numbers v2.15.0
This is the changelog for Cldr v2.15.0 released on June 13th, 2020. For older changelogs please consult the release tag on GitHub
Enhancements
- Support binary locale name as an argument to - Cldr.Number.System.number_system_from_locale/2
- Add - number_system_from_locale/1to backend modules
Cldr_Numbers v2.14.0
This is the changelog for Cldr v2.14.0 released on May 27th, 2020. For older changelogs please consult the release tag on GitHub
Enhancements
- Add - Cldr.Number.Parser.parse/2to parse numbers in a locale-aware manner
- Add - Cldr.Number.Parser.scan/2to parse a string into a list of string and numbers
- Add - Cldr.Number.Parser.resolve_currencies/2to match strings to currency codes in a list
- Add - Cldr.Number.Parser.resolve_currency/2to match a string to a currency code
Cldr_Numbers v2.13.2
This is the changelog for Cldr v2.13.2 released on May 16th, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix regression and allow :percentformats inCldr.Number.to_string/3. Thanks to @maennchen. Fixes #13.
Cldr_Numbers v2.13.1
This is the changelog for Cldr v2.13.1 released on May 14th, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix regression and allow :fractional_digitsto be0. Thanks to @coladarci. Fixes #12.
Cldr_Numbers v2.13.0
This is the changelog for Cldr v2.13.0 released on May 2nd, 2020. For older changelogs please consult the release tag on GitHub
Breaking change
- In previous releases, requesting a currency format in Number.to_string/3without specifying an option:currencywould return an error. In this release, a currency is derived from the locale (either the:localeparameter or frombackend.get_locale()). The affected currency formats are:currency,:accounting,:currency_longand:currency_short
Enhancements
- Cldr.Number.to_string/2now detects the number system from any supplied locale. If provided, the option- :number_systemtakes precedence over the number system derived from a locale.
- Add - :round_nearestformatting option for- Cldr.Number.to_string/3. If provided, this option overrides the value defined by the- :formatoption.
- Refines number system detection. The order of precedence is: - The - :number_systemoption if provided
- The - :number_systemfrom the locale if provided
- The - :number_systemfrom the current locale for the supplied backend. This locale is retrieved with- backend.get_locale()
 
Cldr_Numbers v2.12.1
This is the changelog for Cldr v2.12.1 released on March 2nd, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Use the RBNF format spellout_numberinginstead ofspellout_cardinalfor theCldr.Number.to_string/3optionformat: :spelloutsincespellout_numberinghas a larger locale coverage of RBNF formats.
Cldr_Numbers v2.12.0
This is the changelog for Cldr v2.12.0 released on January 21st, 2020. For older changelogs please consult the release tag on GitHub
Enhancements
- Updates version requirement for cldr_utilsin order to support versions ofdecimalfrom1.6up to2.0.
Bug fixes
- Fixes an incorrect typespec on Cldr.Number.Format.format_from_locale_or_options/1that was causing a dialyzer warning
Cldr_Numbers v2.11.0
This is the changelog for Cldr v2.11.0 released on January 19th, 2020. For older changelogs please consult the release tag on GitHub
Enhancements
- Uses the number system defined by the locale if it is specified.  The number system is defined as part of the U extension. The order of precedence is:- :default if no option is provided to - MyApp.Cldr.Number.to_string/2and no number system is defined in the locale
- The option - :number_systemif it is provided to- MyApp.Cldr.Number.to_string/2
- The locale's - number_systemif it is defined and the option- :number_systemto- MyApp.Cldr.Number.to_string/2is not provided
 
Examples:
 # Locale defines a number system and no option :number_system is provided
 iex> TestBackend.Cldr.Number.to_string(1234, locale: "th-u-nu-thai")
 {:ok, "๑,๒๓๔"}
 # Locale defines a number system but an option :number_system is also provided which
 # take precedence
 iex> MyApp.Cldr.Number.to_string 1234, locale: "th-u-nu-latn", number_system: :thai
 {:ok, "๑,๒๓๔"}
 # A number system is defined in the locale but it is not supported by the
 # locale
 iex> MyApp.Cldr.Number.to_string 1234, locale: "en-AU-u-nu-thai"
 {:error,
  {Cldr.UnknownNumberSystemError,
   "The number system :thai is unknown for the locale named \"en\". Valid number systems are %{default: :latn, native: :latn}"}}- Uses the currency code defined by the locale if it is specified and the number format requested is :currency. The currency code is defined as part of the U extension. The order of precedence is:- The option - :currencyif it is provided to- MyApp.Cldr.Number.to_string/2
- The locale's - currency codeif it is defined and the option- :currencyto- MyApp.Cldr.Number.to_string/2is not provided
 
Examples:
 # Use the currency code :AUD specified in the locale
 iex> MyApp.Cldr.Number.to_string 1234, locale: "en-AU-u-cu-aud", format: :currency
 {:ok, "A$1,234.00"}
 # Use the currency code :USD provided as an option in precedence over the currency code
 # defined by the locale
 iex> MyApp.Cldr.Number.to_string 1234, locale: "en-AU-u-cu-aud", format: :currency, currency: :USD
 {:ok, "$1,234.00"}- Uses the currency format defined by the locale if it is specified and the number format requested is :currencyor:accounting. The currency format is defined as part of the U extension. The order of precedence is:- The locale's - currency formatif it is defined and the option- :formatto- MyApp.Cldr.Number.to_string/2is either- :currencyor- :accounting. Therefore the locales currency format takes precedence over the- :formatargument but only if- :formatis a currency format.
- The option - :formatin every other case
 
Examples:
 # Using in the locale currency format - just happens to be the same as the format option
 iex> MyApp.Cldr.Number.to_string -1234, locale: "en-AU-u-cu-aud-cf-standard", format: :currency
 {:ok, "A$-1,234.00"}
 # The locale format takes precedence over the format option
 iex> MyApp.Cldr.Number.to_string -1234, locale: "en-AU-u-cu-aud-cf-standard", format: :accounting
 {:ok, "A$-1,234.00"}
 iex> MyApp.Cldr.Number.to_string -1234, locale: "en-AU-u-cu-aud-cf-account", format: :accounting
 {:ok, "(A$1,234.00)"}
 iex> MyApp.Cldr.Number.to_string -1234, locale: "en-AU-u-cu-aud-cf-account", format: :currency
 {:ok, "(A$1,234.00)"}Cldr_Numbers v2.10.0
This is the changelog for Cldr v2.10.0 released on January 15th, 2020. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fixes formatting of negative percentages. Actually fixes an issue where the default negative format would be incorrect in many cases. Thanks to @maennchen. Closes #11.
Enhancements
- Optionally logs a warning if compiling a number format at runtime. The warning is emitted only once for each format to reduce log clutter. The log warning is emitted if the backend configuration key :supress_warningsis set tofalse(this is the default value). Thewarn_oncemechanism depends on the availability of the:persistent_termmodule which is only available from OTP 21.2 onwards. On earlier releases of OTP no warning will be emitted.
Cldr_Numbers v2.9.0
This is the changelog for Cldr v2.9.0 released on October 20th, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
- Adds option :currency_symboltoCldr.Number.to_string/2. This option, when set to:isochanges a currency format to force using the ISO currency code instead of the native currency symbol.
Cldr_Numbers v2.8.0
This is the changelog for Cldr v2.8.0 released on October 10th, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
Cldr_Numbers v2.7.2
This is the changelog for Cldr v2.7.2 released on September 7th, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Call Keyword.get_lazy/3when accessingCldr.default_locale/0to avoid exceptions when no default backend is configured but an optional:backendhas been passed.
Cldr_Numbers v2.7.1
This is the changelog for Cldr v2.7.1 released on August 23rd, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix @specforCldr.Number.to_string/3andCldr.Number.to_string!/3
Cldr_Numbers v2.7.0
This is the changelog for Cldr v2.7.0 released on August 21st, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
- An option :backendcan be passed toCldr.Number.to_string/3and it will be used if being called asCldr.Number.to_string/2. This means that for a call likeCldr.Number.to_string(number, backend, options)which has an option:backend, the call can be replaced withCldr.Number.to_string(number, options).
Cldr_Numbers v2.6.4
This is the changelog for Cldr v2.6.4 released on June 16th, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix the default value for the - backendparameter for- Cldr.Number.to_string/3
- Allow - Cldr.Number.to_string/3to be called as- Cldr.Number.to_string <number>, <options>as long as there is a default backend configured in- config.exs.
Cldr_Numbers v2.6.3
This is the changelog for Cldr v2.6.3 released on June 15th, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Correctly interpret the special short format 0to mean "format as a normal decimal or currency number". Thanks to @epilgrim. Closes #10
Cldr_Numbers v2.6.2
This is the changelog for Cldr v2.6.2 released on June 12th, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Don't transliterate in Cldr.Number.Transliterate.transliterate_digits/3iffromandtonumber systems are the same.
Cldr_Numbers v2.6.1
This is the changelog for Cldr v2.6.1 released on June 2nd, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Ensure Cldr.Number.to_string/3doesn't transliterate is the number systems are compatible for a given locale. Basically, if the local and number system don't require transliteration from0..9to another script (like indian, arabic, ...) then we don't do it. This improves performance by about 10% for this common case.
Cldr_Numbers v2.6.0
This is the changelog for Cldr v2.6.0 released on March 28th, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
- Updates to CLDR version 35.0.0 released on March 27th 2019.
Cldr_Numbers v2.5.0
This is the changelog for Cldr v2.5.0 released on March 23rd, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
- Supports Cldr.default_backend()as a default for a backend on functions inCldr.Number
Cldr_Numbers v2.4.4
This is the changelog for Cldr v2.4.4 released on March 21st, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Rbnf.Ordinal and Rbnf.Spellout now respect the optional generation of @moduledocs in a backend
Cldr_Numbers v2.4.3
This is the changelog for Cldr v2.4.3 released on March 20th, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix dialyzer warnings
Cldr_Numbers v2.4.2
This is the changelog for Cldr v2.4.2 released on March 15th, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
- Makes generation of documentation for backend modules optional.  This is implemented by the :generate_docsoption to the backend configuration. The default istrue. For example:
defmodule MyApp.Cldr do
  use Cldr,
    default_locale: "en-001",
    locales: ["en", "ja"],
    gettext: MyApp.Gettext,
    generate_docs: false
endCldr_Numbers v2.4.1
This is the changelog for Cldr v2.4.1 released on March 7th, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix fractional grouping. Previously when there was no grouping, the group size was being set to the number of fractional digits. 
- Fix scientific precision. Previously the mantissa was not being rounded because the prioritisation of significant digits over exponent digits was not being correctly reconciled. 
- Fix formatting precision of an exponent. A format of - 0E00will now format the exponent with two digits.
- Fix o silence dialyzer warnings 
Cldr_Numbers v2.4.0
This is the changelog for Cldr v2.4.0 released on March 4th, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
- Adds Cldr.Number.Format.default_grouping_for/2to return the default grouping of digits for a locale. This is useful for external number formats like ex_cldr_print.
Cldr_Numbers v2.3.0
This is the changelog for Cldr v2.3.0 released on March 1st, 2019. For older changelogs please consult the release tag on GitHub
Enhancements
- Opens up the formatting pipeline for use by other formatting systems like printf. This is implemented by the introduction ofCldr.Number.Format.Metato create the abstract metadata struct. This struct is used forCldr.Number.to_string/3and is now available for use by other libraries. The functionCldr.Number.Formatter.Decimal.to_string/3is the primary function that should be used by other libraries.
Cldr_Numbers v2.2.0
This is the changelog for Cldr v2.2.0 released on Febriuary 24th, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Fix generating an error tuple when the number system is a binary 
- Fix - @docerrors
Enhancements
- Adds - Cldr.Number.Symbol.all_decimal_symbols/1and- Cldr.Number.Symbol.all_grouping_symbols/1that support parsing of numbers. The symbols are returned as a list.
- Adds - Cldr.Number.Symbol.all_decimal_symbols_class/1and- Cldr.Number.Symbol.all_grouping_symbols_class/1. The symbols are returned as a- String.twhich can then be used to define a character class when building a regex.
Cldr_Numbers v2.1.1
This is the changelog for Cldr v2.1.1 released on February 3rd, 2019. For older changelogs please consult the release tag on GitHub
Bug Fixes
- Formats - Decimal.new("-0")the same as- Decimal.new("0")which is to say without the sign. Although the Decimal standard upon which the Decimal library is based allows for- -0, formatting this as a string with the sign is not consistent with the output for integers and floats. Consistency is, in this case, considered to be the correct approach.
- Fix documentation errors 
Cldr_Numbers v2.1.0
This is the changelog for Cldr v2.1.0 released on December 1st, 2018. For older changelogs please consult the release tag on GitHub
Enhancements
- Added Cldr.Number.to_at_least_string/3,Cldr.Number.to_at_most_string/3,Cldr.Number.to_range_string/3andCldr.Number.to_approx_string/3to format numbers in way that conveys the relevant intent. These functions are also defined one each backend. For example, in the"en"locale:
iex> MyApp.Cldr.Number.to_at_least_string 1234
{:ok, "1,234+"}
iex> MyApp.Cldr.Number.to_at_most_string 1234
{:ok, "≤1,234"}
iex> MyApp.Cldr.Number.to_approx_string 1234
{:ok, "~1,234"}
iex> MyApp.Cldr.Number.to_range_string 1234..5678
{:ok, "1,234–5,678"}- Refactored options for Cldr.Numbers.to_string/3and other functions that use the common number formatting options structure. Options are now parsed and contained in aCldr.Number.Format.Optionsstruct. A user-visible benefit is that if passing aCldr.Number.Format.Optionsstruct toCldr.Number.to_string/3then no further validation or normalization will be performed. Therefore if you are formatting in a tight loop and using common options, saving the options in advance will yield some performance improvement. ACldr.Number.Format.Optionsstruct can be returned by calledCldr.Number.Format.Options.validate_options(backend, options).
Cldr_Numbers v2.0.0
This is the changelog for Cldr v2.0.0 released on November 22nd, 2018. For older changelogs please consult the release tag on GitHub
Breaking Changes
- ex_cldr_numbersnow depends upon ex_cldr version 2.0. As a result it is a requirement that at least one backend module be configured as described in the ex_cldr readme.
- The public API is now based upon functions defined on a backend module. Therefore calls to functions such as - Cldr.Number.to_string/2should be replaced with calls to- MyApp.Cldr.Number.to_string/2(assuming your configured backend module is called- MyApp.Cldr).
Enhancements
- Adds - Cldr.Number.validate_number_system/3and- <backend>.Number.validate_number_system/2that are now the canonical way to validate and return a number system from either a number system binary or atom, or from a number system name.
- Cldr.Number.{Ordinal, Cardinal}.pluralize/3now support ranges, not just numbers
- Currency spacing is now applied for currency formatting. Depending on the locale, some text may be placed between the current symbol and the number. This enhanced readability, it does not change the number formatting itself. For example you can see below that for the locale "en", when the currency symbol is text, a non-breaking space is introduced between it and the number. 
iex> MyApp.Cldr.Number.to_string 2345, currency: :USD, format: "¤#,##0.00"
{:ok, "$2,345.00"}
iex> MyApp.Cldr.Number.to_string 2345, currency: :USD, format: "¤¤#,##0.00"
{:ok, "USD 2,345.00"}