希望简单的问题得到一个简单的答案。我只想编写 Django 的过滤器,以便获得格式化的浮点数区域设置感知:
{{123.45|floatformat:1}}
"123.5" <= correct
{{123.45|localize}}
"123,45" <= correct, in my locales decimal separator is a comma
{{123.45|floatformat:1|localize}}
"123.5" <= wrong, point instead of comma. Expected output: "123,5"
如何同时应用两个过滤器?
谢谢。