gpt4 book ai didi

python - 使用 Python 格式化货币

转载 作者:太空宇宙 更新时间:2023-11-03 14:35:09 25 4
gpt4 key购买 nike

我想将整数格式化为具有专业外观的货币字符串。例如:

1200000 -> 120 万美元
456 -> 456.00 美元

你知道一个很好的图书馆吗,最好是本地化处理欧洲格式。

最佳答案

locale.currency()可以处理数字位,但我还没有看到单词部分的模块。

关于python - 使用 Python 格式化货币,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2226935/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com