繁体   English   中英

货币过滤器在计算液中给出磨损的答案 shopify

[英]Money filter giving worng asnwer in calculations liquid shopify

我正在尝试使用我的产品显示折扣后的金额。 它在计算中工作正常

例如,我的总价是 500,折扣是 50%,我得到的答案是 250,这是正确的,但是当我使用货币过滤器显示货币单位时,即(卢比)它给出的错误答案是卢比。 3

                                My code that gives correct output but without currency unit


    {% assign percent_calculated = section.settings.custom_discount_title  | times: productprice  | divided_by: 100  %}
        
  <span href="https://wdtcv.myshopify.com/discount/discount%2520code%2520promo"   style="color:#FFDAB9" >{{ productprice  |minus : percent_calculated }} </span></div>


                             OUTPUT
250 

我想将其显示为卢比。 250 但为了实现这一点,我使用“|money”过滤器并得到错误的答案

{% assign percent_calculated = section.settings.custom_discount_title  | times: productprice  | divided_by: 100  %}
            
      <span href="https://wdtcv.myshopify.com/discount/discount%2520code%2520promo"   style="color:#FFDAB9" >{{ productprice  |minus : percent_calculated | money }} </span></div>

                                               OUTPUT 

卢比。 3(答案应该是 250 卢比)

我得到的解决方案是在我使用它时删除money_without_currency过滤器,因为我很困惑流动语言需要数据类型转换,我之前使用过它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM