Changed digits() to pad to the desired number of digits using leading zeroes.