var length = (number + '').replace('.', '').replace('-', '').length; // for numbers that can be floats or negatives