INNER CODE UNIT · Python

inner

HHammond/PrettyPandas · prettypandas/formatters.py:30

    def inner(v):
        if isinstance(v, Number):
            return ("{{}}{{:{}}}{{}}"
                    .format(number_format)
                    .format(prefix, v, suffix))
        else:
            raise TypeError("Numberic type required.")
    return inner


def as_percent(precision=2, **kwargs):
    """Convert number to percentage string.

    Parameters:
    -----------
    :param v: numerical value to be converted
    :param precision: int
        decimal places to round to

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…