f string format

PHOTO EMBED

Fri May 07 2021 12:37:21 GMT+0000 (Coordinated Universal Time)

Saved by @ianh ##python ##pandas ##format

number = 1_000_000.50
f"${number:,.0f}"
'$1,000,000'

f"${number:,.2f}"
'$1,000,000.50'
content_copyCOPY

https://www.peterbe.com/plog/format-thousands-in-python