Digit works

works for base 6 and base 10