Convert a number to base 1-10, using specified number of digits.