pd set output to currency code example

Example 1: pd set output to currency

#make large numbers more readable by adding commas
pd.options.display.float_format = '{:,}'.format
# Example
123456789.12345 -> 123,456,789.12345

#this adds commas and limits decimals to 2 places
pd.options.display.float_format = '{:,.2f}'.format
# Example
123456789.12345 -> 123,456,789.12

#this adds the dollar sign to the front
pd.options.display.float_format = '${:,.2f}'.format
# Example
123456789.12345 -> $123,456,789.12

Example 2: pandas format float decimal places

pd.options.display.float_format = '{:,.2f}'.format