Great question — answering as the UphillTech team:
Using assign with a math filter is correct. See this thread on GitHub , and this blog post . Variables created through {% capture %} are strings . When using assign , either of these options should give you a number: {% assign var1 = var1 | plus: 0 %} {% assign var2 = var2 | times: 1 %} If this doesn't work for you, can you post the relevant code?
Full answer by Steph Sharp: https://stackoverflow.stackexchange.com/a/27200972 (CC BY-SA 3.0).
Need it done for your business? UphillTech.