📜  python format float as currency - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:52.529000             🧑  作者: Mango

代码示例1
formatted_float = "${:,.2f}".format(1500.2) # Format `1500.2` as currency (note the comma)
print(formatted_float)

# Result: $1,500.20