diff --git a/.coveralls.yml b/.coveralls.yml index 3a0646a..042007d 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1 +1 @@ -repo_token: DPmQxVTui2krriKgoXsUS4ahhOAEY6Ron +repo_token: 5ki6iPbGaiwHzIwcfNDzTXoiqAcffqUQs diff --git a/lib/unit.js b/lib/unit.js index c2bedfa..b5dee29 100644 --- a/lib/unit.js +++ b/lib/unit.js @@ -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); }; @@ -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); }; diff --git a/test/unit.js b/test/unit.js index bf10628..5668e45 100644 --- a/test/unit.js +++ b/test/unit.js @@ -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); @@ -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); });