prettypandas.formatters module

prettypandas.formatters.as_currency(currency='USD', locale=Locale('en_US'))
prettypandas.formatters.as_percent(precision=2, **kwargs)

Convert number to percentage string.

Parameters:
  • v – numerical value to be converted
  • precision – int decimal places to round to
prettypandas.formatters.as_unit(unit, precision=2, location='suffix')

Convert value to unit.

Parameters:
  • v – numerical value
  • unit – string of unit
  • precision – int decimal places to round to
  • location – ‘prefix’ or ‘suffix’ representing where the currency symbol falls relative to the value