toBigNumber = function(number) {
    /*jshint maxcomplexity:5 */
    number = number || 0;
    if (isBigNumber(number))
        return number;

    if (isString(number) && (number.indexOf('0x') === 0 || number.indexOf('-0x') === 0)) {
        return new BigNumber(number.replace('0x',''), 16);
    }

    return new BigNumber(number.toString(10), 10);
}
Takes an input and transforms it into an bignumber

@method toBigNumber
@param {Number|String|BigNumber} a number, string, HEX string or BigNumber
@return {BigNumber} BigNumber