index.js
function(bitcoin) {
    //validate arg
    var bitcoinType = typeof bitcoin;
    if (bitcoinType === 'string') {
      bitcoin = toNumber(bitcoin);
      bitcoinType = 'number';
    }
    if (bitcoinType !== 'number'){
      throw new TypeError('toSatoshi must be called on a number or string, got ' + bitcoinType);
    }

    var bigBitcoin = new Big(bitcoin);
    return Number(bigBitcoin.times(conversion));
  }
function(bitcoin) {
    //validate arg
    var bitcoinType = typeof bitcoin;
    if (bitcoinType === 'string') {
      bitcoin = toNumber(bitcoin);
      bitcoinType = 'number';
    }
    if (bitcoinType !== 'number'){
      throw new TypeError('toSatoshi must be called on a number or string, got ' + bitcoinType);
    }

    var bigBitcoin = new Big(bitcoin);
    return Number(bigBitcoin.times(conversion));
  }
function ( bitcoin ) { //validate arg var bitcoinType = typeof bitcoin ; if ( bitcoinType === 'string' ) { bitcoin = toNumber ( bitcoin ) ; bitcoinType = 'number' ; } if ( bitcoinType !== 'number' ) { throw new TypeError ( 'toSatoshi must be called on a number or string, got ' + bitcoinType ) ; } var bigBitcoin = new Big ( bitcoin ) ; return Number ( bigBitcoin . times ( conversion ) ) ; }
Convert Bitcoin to Satoshi
@param {number|string} bitcoin Amount of Bitcoin to convert
@throws {TypeError} Thrown if input is not a number or string
@returns {number}
Convert Bitcoin to Satoshi