'Formats the RUT from canonical form to the common string representation.
If verifier=None, then the last digit in \'code\' is the verifier.'

def _format(self, code, verifier=None):

    if (verifier is None):
        verifier = code[(-1)]
        code = code[:(-1)]
    while ((len(code) > 3) and ('.' not in code[:3])):
        pos = code.find('.')
        if (pos == (-1)):
            new_dot = (-3)
        else:
            new_dot = (pos - 3)
        code = ((code[:new_dot] + '.') + code[new_dot:])
    return (u'%s-%s' % (code, verifier))
