index.js
function(addr, format){
    if(_.isUndefined(format) || !_.isString(format))
        format = 'hex';

    if(_.isUndefined(addr)
       || !_.isString(addr))
        addr = '0000000000000000000000000000000000000000';

    if(addr.substr(0, 2) == '0x' && format == 'raw')
        addr = addr.substr(2);

    if(addr.substr(0, 2) != '0x' && format == 'hex')
        addr = '0x' + addr;

    return addr;
}
function(addr, format){
    if(_.isUndefined(format) || !_.isString(format))
        format = 'hex';

    if(_.isUndefined(addr)
       || !_.isString(addr))
        addr = '0000000000000000000000000000000000000000';

    if(addr.substr(0, 2) == '0x' && format == 'raw')
        addr = addr.substr(2);

    if(addr.substr(0, 2) != '0x' && format == 'hex')
        addr = '0x' + addr;

    return addr;
}
function ( addr , format ) { if ( _ . isUndefined ( format ) || ! _ . isString ( format ) ) format = 'hex' ; if ( _ . isUndefined ( addr ) || ! _ . isString ( addr ) ) addr = '0000000000000000000000000000000000000000' ; if ( addr . substr ( 0 , 2 ) == '0x' && format == 'raw' ) addr = addr . substr ( 2 ) ; if ( addr . substr ( 0 , 2 ) != '0x' && format == 'hex' ) addr = '0x' + addr ; return addr ; }
Prepair Ethereum address for either raw transactions or browser storage.

@method (formatAddress)
@param {String} addr    An ethereum address to prep
@param {String} format          The format type (i.e. 'raw' or 'hex')
@return {String} The prepaired ethereum address
Prepair Ethereum address for either raw transactions or browser storage .