INNER CODE UNIT · Python
as_percent
HHammond/PrettyPandas · prettypandas/formatters.py:40
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
"""
if not isinstance(precision, Integral):
raise TypeError("Precision must be an integer.")
return _surpress_formatting_errors(
_format_numer(".{}%".format(precision))
)
def as_unit(unit, precision=2, location='suffix'):