Simplify num_digits (use log10)