def format(self, value):
        """
        Formats a value.

        @type value
          `float`
        """
        sign = (
            "" if self.__sign is None
            else "-" if value < 0
            else "+" if self.__sign == "+"
            else " ")

        if math.isnan(value):
            # Not a number.
            result = text.pad(self.__nan_str, self.__width, pad=" ", left=True)

        elif value < 0 and self.__sign is None:
            result = "#" * self.__width

        elif math.isinf(value):
            # Infinite value.
            result = text.pad(
                sign + self.__inf_str, self.__width, pad=" ", left=True)

        else:
            # "Normal" number.
            precision = 0 if self.__precision is None else self.__precision
            rnd_value = round(value, precision)
            abs_value = abs(rnd_value)
            int_value = int(abs_value)
            result = str(int_value)
            if self.__size > len(result):
                # Doesn't fit.
                return "#" * self.__width

            if self.__pad == " ":
                # Space padding precedes the sign.
                result = text.pad(
                    sign + result,
                    self.__size + len(sign), pad=self.__pad, left=True)
            else:
                # The sign must precede zero padding.
                result = sign + text.pad(
                    result, self.__size, pad=self.__pad, left=True)

            if self.__precision is None:
                pass
            elif self.__precision == 0:
                result += self.__point
            else:
                frac = int(round((abs_value - int_value) * self.__multiplier))
                frac = str(frac)
                assert len(frac) <= precision
                frac = text.pad(frac, self.__precision, pad="0", left=True)
                result += self.__point + frac
        return result
dataset/ETHPy150Open twosigma/ngrid/ngrid/formatters.py/FloatFormatter.format/swapped operands of `>`