def numToDigits(num, places):
    """Helper, for converting numbers to textual digits."""
    s = str(num)
    if len(s) < places:
        return '0' * (places - len(s)) + s
    elif len(s) > places:
        return s[len(s) - places:]
    else:
        return s
