Search code examples
pythonpandasdataframenumpycurrency-formatting

How to convert float to currency(US dollar) in a data frame?


my data frame looks like this

How to convert decimal value to US dollar in pandas?

For instance 8.301400 should be $8,30,1400


Solution

  • df['column'] = df['column'].apply(lambda x: f"${x*100000:,.2f}")
    

    I think 100000 is the multiplier, but if it's another one just change it above.