def METHOD_NAME(self, values: list[list], floatdecimal=0) -> str:
    """
    Format a list of lists.
    """
    lvals = flatten(values)
    # Determine the representation
    if all(isinstance(v, int) for v in lvals):
        type_all = int
    else:
        try:
            for v in lvals:
                float(v)
            type_all = float
        except Exception:
            type_all = str
    # Determine the format
    width = max(len(str(s)) for s in lvals)
    if type_all == int:
        formatspec = '>{0}d'.format(width)
    elif type_all == str:
        formatspec = '>{0}'.format(width)
    else:
        # Number of decimal
        maxdec = max(len(str(f-int(f)))-2 for f in lvals)
        ndec = min(max(maxdec, floatdecimal), 10)
        if all(f == 0 or (abs(f) > 1e-3 and abs(f) < 1e4) for f in lvals):
            formatspec = '>{w}.{p}f'.format(w=ndec+5, p=ndec)
        else:
            formatspec = '>{w}.{p}e'.format(w=ndec+8, p=ndec)
    line = '\n'
    for L in values:
        for val in L:
            line += ' {v:{f}}'.format(v=val, f=formatspec)
        line += '\n'
    return line.rstrip('\n')