Browse Source

Correct millis unit typo.

patch-2
Braydon Fuller 9 years ago
parent
commit
d3a8926bd9
  1. 4
      lib/unit.js
  2. 4
      test/unit.js

4
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);
};

4
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);
});

Loading…
Cancel
Save