Forum Discussion
stella_issupow
2 years agoActive Member II
Liquid: Parse from Point to Comma
Hi community!
I'm currently in the middle of creating in-app messages using personalization with custom attributes. One of the attributes is a number that is divided by a point, e.g. 500.90, as in ...
- 2 years ago
Hey Stella - you should be able to handle this with the replace filter, and {{custom_attribute.${your_attribute} | replace: ".", "," }}
My test example:Set values: {% assign amount = 500.90 %} {% assign amount2 = amount | replace: ".", "," %} Print results: amount: {{amount}}$ amount2: {{amount2}}$ Output: amount: 500.9$ amount2: 500,9$
nathanhunter
Active Member
Hey Stella - you should be able to handle this with the replace filter, and {{custom_attribute.${your_attribute} | replace: ".", "," }}
My test example:
Set values:
{% assign amount = 500.90 %}
{% assign amount2 = amount | replace: ".", "," %}
Print results:
amount: {{amount}}$
amount2: {{amount2}}$
Output:
amount: 500.9$
amount2: 500,9$
stella_issupow
2 years agoActive Member II
Hi Nathan, amazing, that worked for me as well! Cheers
Related Content
- 6 months ago