def _str(self, i, x):
        """Handles string formatting of cell data

            i - index of the cell datatype in self._dtype 
            x - cell data to format
        """
        try:
            f = float(x)
        except:
            return str(x)

        n = self._precision
        dtype = self._dtype[i]

        if dtype == 'i':
            return str(int(round(f)))
        elif dtype == 'f':
            return '%.*f' % (n, f)
        elif dtype == 'e':
            return '%.*e' % (n, f)
        elif dtype == 't':
            return str(x)
        else:
            if f - round(f) == 0:
                if abs(f) > 1e8:
                    return '%.*e' % (n, f)
                else:
                    return str(int(round(f)))
            else:
                if abs(f) > 1e8:
                    return (n, f) % '%.*e'
                else:
                    return '%.*f' % (n, f)
dataset/ETHPy150Open mesosphere/chronos-utils/lib/texttable/texttable.py/Texttable._str/swapped operands of `%`