Shopify variants label

I have this code of variants label i want to show label in Rupees like save Rs.200 compare with their price but it will show in percentage like 18%

This is the code is any one help me

{%- when ‘product_price’ -%}

{{ product.selected_or_first_available_variant.price | money }} {%- if product.compare_at_price_max > product.price -%} {{ product.selected_or_first_available_variant.compare_at_price | money }} {%- endif -%} {{- product.selected_or_first_available_variant.unit_price | money -}} {%- if product.selected_or_first_available_variant.unit_price_measurement.reference_value != 1 -%} {{- product.selected_or_first_available_variant.unit_price_measurement.reference_value -}} {%- endif -%} {{ product.selected_or_first_available_variant.unit_price_measurement.reference_unit }}
{% if settings.sale_percent_enable %}
{{ product.selected_or_first_available_variant.compare_at_price | minus: product.selected_or_first_available_variant.price | times: 100.0 | divided_by: product.selected_or_first_available_variant.compare_at_price | money_without_currency | replace: ',', '.' | times: 100 | remove: '.0' }}
{% endif %}

Try This one Code

{%- when 'product_price' -%}

  

    {{ product.selected_or_first_available_variant.price | money }}
    {%- if product.compare_at_price_max > product.price -%}
    {{ product.selected_or_first_available_variant.compare_at_price | money }}
    {%- endif -%}
    <small>
      
        {{- product.selected_or_first_available_variant.unit_price | money -}}
        
          {%- if product.selected_or_first_available_variant.unit_price_measurement.reference_value != 1 -%}
          {{- product.selected_or_first_available_variant.unit_price_measurement.reference_value -}}
          {%- endif -%}
          {{ product.selected_or_first_available_variant.unit_price_measurement.reference_unit }}
        
      
    </small>
  

  {%- if settings.sale_percent_enable and product.selected_or_first_available_variant.compare_at_price > product.selected_or_first_available_variant.price -%}
  
    
      {% assign discount_amount = product.selected_or_first_available_variant.compare_at_price | minus: product.selected_or_first_available_variant.price %}
      Save Rs.{{ discount_amount | money_without_currency }}
    
  

  {%- endif -%}

Hi, @WaqarAliAshraf

The bottom paragraph should be modified as follows

{% if settings.sale_percent_enable %}
  
   
    {{ 
       product.selected_or_first_available_variant.compare_at_price | minus: 
       product.selected_or_first_available_variant.price
     }}
   
  

{% endif %}

Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!

Hello @WaqarAliAshraf
Try this code

{%- when 'product_price' -%}

    

        {{ product.selected_or_first_available_variant.price | money }}
        {%- if product.compare_at_price_max > product.price -%}
            {{ product.selected_or_first_available_variant.compare_at_price | money }}
        {%- endif -%}
        <small>
            
                {{- product.selected_or_first_available_variant.unit_price | money -}}
                
                    {%- if product.selected_or_first_available_variant.unit_price_measurement.reference_value != 1 -%}
                        {{- product.selected_or_first_available_variant.unit_price_measurement.reference_value -}}
                    {%- endif -%}
                    {{ product.selected_or_first_available_variant.unit_price_measurement.reference_unit }}
                
            
        </small>
    

    {% if settings.sale_percent_enable %}
        
            {% assign savings = product.selected_or_first_available_variant.compare_at_price | minus: product.selected_or_first_available_variant.price %}
            {% if savings > 0 %}
                
                    Save Rs.{{ savings | money_without_currency }}
                
            {% else %}
                
                    {{ product.selected_or_first_available_variant.compare_at_price | minus: product.selected_or_first_available_variant.price | times: 100.0 | divided_by: product.selected_or_first_available_variant.compare_at_price | money_without_currency | replace: ',', '.' | times: 100 | remove: '.0' }}%
                
            {% endif %}
        

    {% endif %}

let me know if this works.