RubyMoney/money — Issue #146: Handle currencies with subunits of 4 decimal places
Author: alup
Created: 2012-02-23 13:22:29+00:00
State: open

There are cases where we need to create custom mappings from e.g. 1 euro to 10000 subunits (or 100 subunits of a eurocent). For example, in telecommunication companies there are costs per second such as 0,0032 € / sec.

To handle this, there should be support for 4 decimal places for subunits.

```
DECIMAL_PLACES_MAP = {
1 => 0,
5 => 1,
10 => 1,
100 => 2,
1000 => 3,
10000 => 4
}
```

or the old way (which is not fully correct)

```
def decimal_places
if subunit_to_unit == 1
0
elsif subunit_to_unit % 10 == 0
Math.log10(subunit_to_unit).to_s.to_i
else
Math.log10(subunit_to_unit).to_s.to_i+1
end
end
```