prettynum

Simple number formatting for python


Keywords
python, formatting
License
MIT
Install
pip install prettynum==0.1.0

Documentation

prettynum

Simple number formatting for python inspired by the scales package in R. prettynum is lightweight and has not third party library dependencies.

Installation

pip install prettynum

Usage

>>> from prettynum import comma, dollar
>>> comma(1000)
'1,000'
>>> comma(1000, 3)
'1,000.000'
>>> comma(1000.89, 1)
'1,000.9'
>>> dollar(1000)
'$1,000'
>>> dollar(1000, 3)
'$1,000.000'
>>> dollar(1000.89, 1)
'$1,000.9'