Changelog for 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

Changelog for 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 :backend can be passed to Cldr.Number.to_string/3 and it will be used if being called as Cldr.Number.to_string/2. This means that for a call like Cldr.Number.to_string(number, backend, options) which has an option :backend, the call can be replaced with Cldr.Number.to_string(number, options).

Changelog for 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

Changelog for 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 0 to mean "format as a normal decimal or currency number". Thanks to @epilgrim. Closes #10

Changelog for 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

Changelog for 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/3 doesn't transliterate is the number systems are compatible for a given locale. Basically, if the local and number system don't require transliteration from 0..9 to another script (like indian, arabic, ...) then we don't do it. This improves performance by about 10% for this common case.

Changelog for 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

Changelog for 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 in Cldr.Number

Changelog for 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

Changelog for 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

Changelog for 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_docs option to the backend configuration. The default is true. For example:
defmodule MyApp.Cldr do
  use Cldr,
    default_locale: "en-001",
    locales: ["en", "ja"],
    gettext: MyApp.Gettext,
    generate_docs: false
end

Changelog for Cldr_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 0E00 will now format the exponent with two digits.

  • Fix o silence dialyzer warnings

Changelog for 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

Changelog for 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

Changelog for 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 @doc errors

Enhancements

Changelog for 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

Changelog for 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

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/3 and other functions that use the common number formatting options structure. Options are now parsed and contained in a Cldr.Number.Format.Options struct. A user-visible benefit is that if passing a Cldr.Number.Format.Options struct to Cldr.Number.to_string/3 then 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. A Cldr.Number.Format.Options struct can be returned by called Cldr.Number.Format.Options.validate_options(backend, options).

Changelog for 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_numbers now 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/2 should 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/3 and <backend>.Number.validate_number_system/2 that 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/3 now 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 readibility, 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"}