Dividing total quote amount

Quick question about quotes!
I’m wanting to write a section in a quote where I show the quote amount % 3. I am using the comments box for this as I don’t really want to touch the code.
I have got this for the total quote price :
<p>{{ personalization_token(‘template_data.quote.hs_quote_amount’, ‘’)|render|format_currency(template_data.quote.hs_locale, template_data.quote.hs_currency, true, true) }}</p>
and this for divided by :
{% set numerator = 106 %}
{{ numerator|divide(2) }}
But when I combine the 2 :
<p>{% set numerator = {{ personalization_token(‘template_data.quote.hs_quote_amount’, ‘’)|render|format_currency(template_data.quote.hs_locale, template_data.quote.hs_currency, true, true) }} %} {{ numerator|divide(2) }}</p>

It shows an output of 0! I think this may be due to the face that total quote renders with a currency. How could I go about making this work?

Thanks!

Hey, @PJenkins I think you’re on the right track.

The divide filter expects a numerical value, but format_currency returns a string with currency symbols, commas, etc., which cannot be divided.

Have you tried to divide template_data.quote.hs_quote_amount before formatting it as currency?

Have fun building! — Jaycee