Home > Back-end >  How to convert float to currency(US dollar) in a data frame?
How to convert float to currency(US dollar) in a data frame?

Time:11-13

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

CodePudding user response:

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.

  • Related