Skip to content

Commit

Permalink
Fix money parsing error. Closes #112
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Nov 10, 2019
1 parent e7eb694 commit 7b1962a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Changelog for Money v4.4.1

This is the changelog for Money v4.4.1 released on November 10th, 2019. For older changelogs please consult the release tag on [GitHub](https://github.com/kipcole9/money/tags)

### Bug Fixes

* Fixes money parsing error. Thanks to @Doerge. Closes #112.

# Changelog for Money v4.4.0

This is the changelog for Money v4.4.0 released on November 6th, 2019. For older changelogs please consult the release tag on [GitHub](https://github.com/kipcole9/money/tags)
Expand Down
2 changes: 1 addition & 1 deletion lib/money/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule Money.Parser do
|> label("whitespace")
end

@separators [?,, , , ?、, ?︐, ?︑, ?﹐, ?﹑, ?,, ?、, ? ]
@separators [?., ?,, , , ?、, ?︐, ?︑, ?﹐, ?﹑, ?,, ?、, ? ]
def separators do
utf8_char(@separators)
|> label("separators")
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 Money.Mixfile do
use Mix.Project

@version "4.4.0-dev"
@version "4.4.1"

def project do
[
Expand Down
4 changes: 4 additions & 0 deletions test/money_parse_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,9 @@ defmodule MoneyTest.Parse do
assert Money.parse("kr-127,54", locale: "da") == Money.new(:DKK, "-127.54")
assert Money.parse("kr -127,54", locale: "da") == Money.new(:DKK, "-127.54")
end

test "de locale" do
assert Money.parse("1.127,54 €", locale: "de") == Money.new(:EUR, "1127.54")
end
end
end

0 comments on commit 7b1962a

Please sign in to comment.