Skip to content

Conversation

@dependabot
Copy link

@dependabot dependabot bot commented on behalf of github Jan 17, 2023

Bumps ex_cldr_numbers from 2.27.2 to 2.29.0.

Release notes

Sourced from ex_cldr_numbers's releases.

Cldr Numbers version 2.29.0

Behavior change

  • In prior releases formatting a number as format: :currency would derive the currency code from the locale if no :currency_code was provided. This is no longer the case. As of CLDR42 a format :currency_no_symbol is defined to allow formatting of the number without an associated symbol. Now when format: :currency is passed without a :currency_code option, the format is changed to format: :currency_no_symbol. To retain the existing behaviour, pass currency_code: 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 :wrapper to Cldr.Number.to_string/2. The argument is a 2-arity function that receives the parameters string and tag where tag is one of :number, :currency_symbol, :currency_space, :literal, :quote, :percent, :permille, :minus or :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=&quot;symbol&quot;>$</span><span class=&quot;number&quot;>100.00</span>"}

  • Adds the number formats :currency_no_symbol and :accounting_no_symbol that can be used to format currency amounts without an associated currency symbol.

  • Removes the Cldr.Number.to_string/3 requirement for a currency to be provided (or derived) when the format is :currency. If a currency is provided, the format :currency is used. If a currency is not provided, the format :currency_no_symbol is used.

Cldr Numbers version 2.28.0

Enhancements

  • Encapsulates CLDR 42 data. Unless otherwise noted, all the changes are reflected in ex_cldr libraries and functions.

Updated data from CLDR

  • Two new values for pattern elements used for currency format elements:
    • alpha_next_to_number: A pattern to use when the currency symbol would result in letter characters being adjacent to the numeric value; typically this adds a no-break space between the currency symbol and numeric value, if the standard currency format pattern does not already have a space. This provides an improved alternative to the currency spacing patterns.
    • no_currency: A pattern to use when currency-style formats are desired but without the actual symbol (as in a table of currency values all fo the same currency).
  • For the currency formats element, a new element currency_pattern_append_ISO containing a pattern that shows how to append an ISO currency symbol (¤¤) to a currency pattern using a standard currency symbol (¤); this is needed for certain types of currency display.
  • Although these data changes are incorporated, the formatting functions do not expose them. They will be added in an update to ex_cldr_numbers by year end 2022.

Cldr Numbers version 2.27.3

Bug Fixes

... (truncated)

Changelog

Sourced from ex_cldr_numbers's changelog.

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: :currency would derive the currency code from the locale if no :currency_code was provided. This is no longer the case. As of CLDR42 a format :currency_no_symbol is defined to allow formatting of the number without an associated symbol. Now when format: :currency is passed without a :currency_code option, the format is changed to format: :currency_no_symbol. To retain the existing behaviour, pass currency_code: 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 :wrapper to Cldr.Number.to_string/2. The argument is a 2-arity function that receives the parameters string and tag where tag is one of :number, :currency_symbol, :currency_space, :literal, :quote, :percent, :permille, :minus or :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=&quot;symbol&quot;>$</span><span class=&quot;number&quot;>100.00</span>"}

  • Adds the number formats :currency_no_symbol and :accounting_no_symbol that can be used to format currency amounts without an associated currency symbol.

  • Removes the Cldr.Number.to_string/3 requirement for a currency to be provided (or derived) when the format is :currency. If a currency is provided, the format :currency is used. If a currency is not provided, the format :currency_no_symbol is 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_cldr libraries 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

... (truncated)

Commits
  • 7d388c8 Update changelog with additional examples of wrapping
  • 0665735 :wrapper option can return Phoenix.HTML safe strings which means using those ...
  • 935a170 Improve wrapper docs after @​rubas feedback
  • dc81a40 Fix duplicated doc text
  • e5c7156 Update docs for release 2.29.0
  • 9f6fc54 Support :currency_no_symbol to_string option
  • 36296e7 Add :wrapper option to Cldr.Number.to_string/2
  • 4816c36 Fix changelog heading
  • 1e9ebf9 Ready for release 2.28.0
  • 2161d3e Bump ex_cldr dependency
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [ex_cldr_numbers](https://github.com/elixir-cldr/cldr_numbers) from 2.27.2 to 2.29.0.
- [Release notes](https://github.com/elixir-cldr/cldr_numbers/releases)
- [Changelog](https://github.com/elixir-cldr/cldr_numbers/blob/master/CHANGELOG.md)
- [Commits](elixir-cldr/cldr_numbers@v2.27.2...v2.29.0)

---
updated-dependencies:
- dependency-name: ex_cldr_numbers
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code labels Jan 17, 2023
@cla-bot cla-bot bot added the cla-signed label Jan 17, 2023
@dependabot @github
Copy link
Author

dependabot bot commented on behalf of github Jun 27, 2025

Superseded by #197.

@dependabot dependabot bot closed this Jun 27, 2025
@dependabot dependabot bot deleted the dependabot/hex/ex_cldr_numbers-2.29.0 branch June 27, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant