我想设定我自己的货币(优先选择后面的货币)
def total_price(self):
items = SellItem.objects.filter(selllist=self)
total = 0
for item in items:
total += item.amount * item.price
locale.setlocale(locale.LC_ALL, '')
total = locale.currency(total, grouping=True)
return total
现在我想使用分组,但不是前面的$,而是后面的ISK。 不太清楚该怎么做
你可以试试下面的例子。第一个print语句将以字符串形式给出当前的区域设置值(例如:en_IN for india),第二个语句将提供一个包含区域设置值和iso代码的元组(例如:('en_IN','ISO8859-1'))
相关问题 更多 >
编程相关推荐