def formatToAddressLength(format: str) ->int:
    """Return the length -in characters- that an address must have,
    according to a format"""
    if format == 'S19':
        return 4
    elif format == 'S28':
        return 6
    elif format == 'S37':
        return 8
    else:
        raise ValueError(
            'Invalid parameter in method formatToAddressLength: %s' % format)
