index.js
function(satoshi) {
    //validate arg
    var satoshiType = typeof satoshi;
    if (satoshiType === 'string') {
      satoshi = toNumber(satoshi);
      satoshiType = 'number';
    }
    if (satoshiType !== 'number'){
      throw new TypeError('toBitcoin must be called on a number or string, got ' + satoshiType);
    }
    if (!Number.isInteger(satoshi)) {
      throw new TypeError('toBitcoin must be called on a whole number or string format whole number');
    }

    var bigSatoshi = new Big(satoshi);
    return Number(bigSatoshi.div(conversion));
  }
function(satoshi) {
    //validate arg
    var satoshiType = typeof satoshi;
    if (satoshiType === 'string') {
      satoshi = toNumber(satoshi);
      satoshiType = 'number';
    }
    if (satoshiType !== 'number'){
      throw new TypeError('toBitcoin must be called on a number or string, got ' + satoshiType);
    }
    if (!Number.isInteger(satoshi)) {
      throw new TypeError('toBitcoin must be called on a whole number or string format whole number');
    }

    var bigSatoshi = new Big(satoshi);
    return Number(bigSatoshi.div(conversion));
  }
function ( satoshi ) { //validate arg var satoshiType = typeof satoshi ; if ( satoshiType === 'string' ) { satoshi = toNumber ( satoshi ) ; satoshiType = 'number' ; } if ( satoshiType !== 'number' ) { throw new TypeError ( 'toBitcoin must be called on a number or string, got ' + satoshiType ) ; } if ( ! Number . isInteger ( satoshi ) ) { throw new TypeError ( 'toBitcoin must be called on a whole number or string format whole number' ) ; } var bigSatoshi = new Big ( satoshi ) ; return Number ( bigSatoshi . div ( conversion ) ) ; }
Convert Satoshi to Bitcoin
@param {number|string} satoshi Amount of Satoshi to convert. Must be a whole number
@throws {TypeError} Thrown if input is not a number or string
@throws {TypeError} Thrown if input is not a whole number or string format whole number
@returns {number}
Convert Satoshi to Bitcoin