demchenkoe/bigmoney.js — pull request #1 by renatoargh (2014-02-27 04:04:20+00:00)
Title: Implemented "allocate" function, as described by Martin Fowler

Hi @demchenkoe,

This pull request adds the feature of allocation. It is basically a way to "divide" money without loosing cents, and it is described by Martin Fowler in his book "[Patterns of Enterprise Application Architecture](http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420/ref=sr_1_1?ie=UTF8&qid=1393473741&sr=8-1&keywords=patterns+of+enterprise+application+architecture)" and [here](http://martinfowler.com/eaaCatalog/money.html).

An example of how it works:

### Basic Functionality
```javascript
var amountDue = new Money(100),
payments = amountDue.allocate(3);

//payments is now an array whose sum equals to 100 USD
payments.forEach(function(payment) {
//will print; $33.33, then $33.33, then $33.34
console.log(payment.format());
});
```

### Applying different ratios
```javascript
var amountDue = new Money(123),
//this means three payments of 25%, 50% and 25%
payments = amountDue.allocate([1, 2, 1]);

//payments is now an array whose sum equals to 123 USD
payments.forEach(function(payment) {
//will print; $30.75, then $61.50, then $30.75
console.log(payment.format());
});
```

Also I have added my name as contributor at `package.json` and have bumped the version to `v0.0.2` in case you find this cool enough to merge.

Thank you for the cool module!