Skip to content

Commit

Permalink
Update mix and changelog for version 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Jan 13, 2018
1 parent 90d0f52 commit f1dc8a5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
27 changes: 25 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
# Changelog for Cldr v1.2.0
# Changelog for Cldr v1.3.0

This is the changelog for Cldr v1.3.0 released on January 14th, 2018. For older changelogs please consult the release tag on [GitHub](https://github.com/kipcole9/cldr/tags)

### Enhancements

* Add `Cldr.Digits.number_of_digits/1` that returns the number of digits (precision) of a float, integer or Decimal. The primary intent is to support better detection of precision errors after parsing a float string. A double precision 64-bit float (which is what Erlang/Elixir use) can safely support 15 digits. According to [Wikipedia](https://en.wikipedia.org/wiki/IEEE_754#Character_representation) a decimal floating point number should round-trip convert to string representation and back for 16 digits without rounding (and 17 using "round to even"). Some examples:

```
iex> Cldr.Digits.number_of_digits(1234)
4
This is the changelog for Cldr v1.2.0 released on January 9th, 2018. For older changelogs please consult the release tag on [GitHub](https://github.com/kipcole9/cldr/tags)
iex> Cldr.Digits.number_of_digits(Decimal.new("123456789"))
9
iex> Cldr.Digits.number_of_digits(1234.456)
7
iex> Cldr.Digits.number_of_digits(1234.56789098765)
15
iex> Cldr.Digits.number_of_digits '12345'
5
```

# Changelog for Cldr v1.2.0

### Bug Fixes

Expand Down
1 change: 1 addition & 0 deletions lib/cldr/helpers/digits.ex
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ defmodule Cldr.Digits do
iex> Cldr.Digits.fraction_as_integer(1999)
0
"""
@spec fraction_as_integer(Math.number_or_decimal() | {list, list, 1 | -1}) :: integer
def fraction_as_integer({_integer, fraction, _sign})
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Cldr.Mixfile do
use Mix.Project

@version "1.2.0"
@version "1.3.0"

def project do
[
Expand Down

0 comments on commit f1dc8a5

Please sign in to comment.