Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade: Bump ex_cldr_numbers from 2.27.3 to 2.30.0 #112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Mar 7, 2023

Bumps ex_cldr_numbers from 2.27.3 to 2.30.0.

Release notes

Sourced from ex_cldr_numbers's releases.

Cldr Numbers version 2.30.0

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_cldr version 2.35.0 or later is required.

Enhancements

  • Supports the :default_currency_format backend configuration option introduced in ex_cldr version 2.35.0.

  • Adds :from_locale as a valid value to the :currency option to Cldr.Number.to_string/3. If set, the currency is derived from the locale.

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

... (truncated)

Changelog

Sourced from ex_cldr_numbers's changelog.

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_cldr version 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_format backend configuration option introduced in ex_cldr version 2.35.0.

  • Adds :from_locale as a valid value to the :currency option 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: :currency would derive the currency code from the locale if no :currency 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 option, 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 :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>"}
</tr></table>

... (truncated)

Commits
  • 69d417d Elixir 1.11 or later only
  • 2db5463 Allow :from_locale as an option to :currency
  • 075970d Verify :default_currency_format backend option
  • 322bcab Mix format and improve Cldr.Number.Formatter.Decimal docs
  • a0dc077 Update changelog
  • ce0baf7 Fix currency_long_with_symbol formatting
  • 884db41 Fix wrapper test
  • c66d78b Fix most long and short formats
  • 3f30029 Support alpha_next_to_number formats
  • bfd8f95 One more changelog fix
  • 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.3 to 2.30.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.3...v2.30.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 Mar 7, 2023
@sonarcloud
Copy link

sonarcloud bot commented Mar 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

0 participants