An open API service indexing awesome lists of open source software.

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.

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

```