相关疑难解决方法(0)

在不使用手动创建的模板标记的情况下在django模板中进行乘法

我想在django模板中实现乘法运算.例如,我有值,price = 10.50 quantity = 3

借助此链接

http://slacy.com/blog/2010/07/using-djangos-widthratio-template-tag-for-multiplication-division/

我尝试下面的代码来实现它,

{% widthratio quantity 1 price %}
Run Code Online (Sandbox Code Playgroud)

但它只返回31.但我需要浮动答案(31.5)

我想在不使用手动创建的标签的情况下实现它

我怎样才能实现它?提前致谢...

django-templates

15
推荐指数
4
解决办法
3万
查看次数

标签 统计

django-templates ×1