我用这个包来装饰我的货币领域:
https://github.com/django-money/django-money
我有一个模态场:
client_cost = MoneyField(
_('client cost'),
max_digits=10,
decimal_places=2,
default_currency='AUD',
null=True,
)
现在我想对它进行一些计算,所以我使用int(client_cost)
将其转换为int
但是我得到了一个错误(很明显):
^{pr2}$
请帮忙。在
Tags:
您正在处理一个
Money
对象(see here)。该对象具有一个amount
属性,该属性将给出十进制数:如果愿意,可以将其转换为
int
。在相关问题 更多 >
编程相关推荐