Django separate thousands in template

后端 未结 2 1517
傲寒
傲寒 2021-02-07 13:30

My model is returning a Decimal(1234567.50), I can\'t seem to display the Decimal with a thousands separator. Does Django have a way to do this? Do I need to create my own templ

2条回答
  •  渐次进展
    2021-02-07 14:01

    You can use the intcomma filter, but I don't think it will work on Decimal objects and it works on Decimal objects. You'll have to convert to float/string first.

提交回复
热议问题