A library for converting various objects into Money
objects.
Add this line to your application's Gemfile:
gem 'monetize'
And then execute:
$ bundle
Or install it yourself as:
$ gem install monetize
Monetize.parse("$100") == Money.new(100_00, "USD")
Monetize.parse("€100") == Money.new(100_00, "EUR")
Monetize.parse("£100") == Money.new(100_00, "GBP")
"100".to_money == Money.new(100_00, "USD")
Optionally, enable the ability to assume the currency from a passed symbol.
Monetize.assume_from_symbol = true
"100".to_money == Money.new(100_00, "USD")
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request