Skip to content

Commit

Permalink
Correct millis unit typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Braydon Fuller committed Oct 27, 2015
1 parent c6593f1 commit d3a8926
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Unit.fromBTC = function(amount) {
* @param {Number} amount - The amount in mBTC
* @returns {Unit} A Unit instance
*/
Unit.fromMilis = function(amount) {
Unit.fromMillis = Unit.fromMilis = function(amount) {
return new Unit(amount, Unit.mBTC);
};

Expand Down Expand Up @@ -173,7 +173,7 @@ Unit.prototype.toBTC = function() {
*
* @returns {Number} The value converted to mBTC
*/
Unit.prototype.toMilis = function() {
Unit.prototype.toMillis = Unit.prototype.toMilis = function() {
return this.to(Unit.mBTC);
};

Expand Down
4 changes: 4 additions & 0 deletions test/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ describe('Unit', function() {
unit = Unit.fromMilis('1.00001');
unit.mBTC.should.equal(1.00001);

unit = Unit.fromMillis('1.00001');
unit.mBTC.should.equal(1.00001);

unit = Unit.fromBits('100');
unit.bits.should.equal(100);

Expand Down Expand Up @@ -136,6 +139,7 @@ describe('Unit', function() {
var unit = new Unit(1.3, 'BTC');
unit.toBTC().should.equal(unit.BTC);
unit.toMilis().should.equal(unit.mBTC);
unit.toMillis().should.equal(unit.mBTC);
unit.toBits().should.equal(unit.bits);
unit.toSatoshis().should.equal(unit.satoshis);
});
Expand Down

0 comments on commit d3a8926

Please sign in to comment.