我需要像Jinja"nl2br"这样的过滤器,但是在Nunjucks中.在文档中提到(https://mozilla.github.io/nunjucks/templating.html),但我在nunjucks代码中搜索它(https://github.com/mozilla/nunjucks/blob/master/src /filters.js)并且它不存在.
有人知道如何使用等效过滤器或其他解决方案解决它?或者我需要创建过滤器?
我想用Intl的NumberFormat格式化货币,并获得返回值,在符号和数字之间加一个空格"".
new Intl.NumberFormat('pt-br', { style: 'currency', currency: 'USD' }).format(12345)
// "US$12.345,00"
new Intl.NumberFormat('pt-br', { style: 'currency', currency: 'BRL' }).format(12345)
// "R$12.345,00"
Run Code Online (Sandbox Code Playgroud)
我想要的是:"US $ 12.345,00","R $ 12.345,00"
有任何想法吗?