pd set output to currency

Solutions on MaxInterview for pd set output to currency by the best coders in the world

showing results for - "pd set output to currency"
Pansy
20 Sep 2018
1#make large numbers more readable by adding commas
2pd.options.display.float_format = '{:,}'.format
3# Example
4123456789.12345 -> 123,456,789.12345
5
6#this adds commas and limits decimals to 2 places
7pd.options.display.float_format = '{:,.2f}'.format
8# Example
9123456789.12345 -> 123,456,789.12
10
11#this adds the dollar sign to the front
12pd.options.display.float_format = '${:,.2f}'.format
13# Example
14123456789.12345 -> $123,456,789.12