https://github.com/hoodie/euro
Convenience code for calculating with money, uses rational numbers.
https://github.com/hoodie/euro
Last synced: about 1 month ago
JSON representation
Convenience code for calculating with money, uses rational numbers.
- Host: GitHub
- URL: https://github.com/hoodie/euro
- Owner: hoodie
- License: gpl-2.0
- Created: 2014-10-28T13:35:59.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-10T11:25:44.000Z (over 10 years ago)
- Last Synced: 2025-02-10T08:44:13.637Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 184 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Euro
Simply rational numbers, conversion from other types and pretty printing.
## note
works with ruby 1.8 as well, there is just one test failing.## installation
```shell
gem install Euro
```## usage
```ruby
require 'Euro'pocket_money = Euro.new 5.0
pocket_money = 5.to_euro
puts pocket_monet # => "5,00€"pocket_money += 1.66
puts pocket_monet # => "6,66€"1 + pocket_money # => TypeError: Euro can't be coerced into Fixnum
```