I just read this related answer:
How can I convert a number to a string? - Shopify Design — Ecommerce University
To convert a string to a number just add 0 to the variable:
{% assign variablename = variablename | plus:0 %}
Not super elegant but it works!
Inelegant or not, the answer given there isn't working for me. What's the right way to do this?
Are the Liquid docs really missing such basic answers or am I just not finding the right place to look?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…