【发布时间】:2020-08-06 00:38:05
【问题描述】:
有人知道两个值是否可以相除吗?
例如:
产品价格/单价=想要的结果
产品价格:
{{price.without_tax.formatted}}
单价过滤器
{{#filter custom_fields 'Units per case' property='name'}}
<p>{{ value}}</p>
{{/filter}}
如果我要使用类似的东西:
{{#filter custom_fields 'Units per case' property='name'}}
<p>{{toFixed price.without_tax.formatted divide value}}</p>
{{/filter}}
我得到一个 0。如果我不包括 toFixed 那么什么都不会出现。不知道如何进行。请帮忙。
(我知道这是一些疯狂的代码,但我不知道更好。)
【问题讨论】: