Shopify — Liquid, Convert string to integer

Dealing with my latest project’s issues, I realize that, Liquid seems to be treating the metafield as a string even though the API confirms the metafield is an integer. So if you want to convert a metafield value into integer value, you may have to use this snippet code:

{% assign items_per_page = settings.collection_items_per_page | plus: 0 %}

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.