RubyMoney / monetize

A library for converting various objects into `Money` objects.
MIT License
430 stars 107 forks source link

Does not parse currency symbol after amount #108

Closed imargonis closed 4 years ago

imargonis commented 7 years ago

Monetize.parse seems to only look in front of the value and ignores anything after. It is common for EUR to be written after the value.

> Monetize.assume_from_symbol = true
 => true
> price = "13,23 €"
=> "13,23 €"
> Monetize.parse(price)
 => #<Money fractional:1323 currency:USD>
> price = "€ 13,56"
 => "€ 13,56"
> Monetize.parse(price)
 => #<Money fractional:1356 currency:EUR>
antstorm commented 7 years ago

@imargonis that's a really good point, I'll have a look at solving it. You are also welcome to submit a PR if you have time

BKDruby commented 6 years ago

@antstorm How could I make PR?

I can't push my branch to repo.

antstorm commented 6 years ago

@BKDruby sweet! You should be able to open a pull request on the monetize repo, comparing your fork's master with base master

mensfeld commented 6 years ago

Any update on this one?

antstorm commented 6 years ago

@mensfeld doesn't look like it. @BKDruby any news?

We might need to rethink how monetize does parsing, because there's a number of other issues with the current solution.

antstorm commented 4 years ago

Should have been fixed by https://github.com/RubyMoney/monetize/pull/131, closing. Please feel free to re-open if there are still issues