CMS Development

KimJ
Participant

HubL syntax for currency property?

I'm attempting to use a currency property in an if statement. Can anyone tell me what the proper syntax is for a currency property? I'm using the price property on line items. It does not seem to work when I treat it as an integer.

 

{% if line_item.price == 0 %}

 

Thanks!

0 Upvotes
3 Replies 3
TDwebdev
Contributor | Diamond Partner
Contributor | Diamond Partner

HubL syntax for currency property?

Hi KimJ,

 

U can use: 

 

{% set price = 1234.56 %}
{{ price|format_currency('USD', 'en-US') }}

 



Vet Digital

Did my post solve your question? Help the community by marking it as a solution
0 Upvotes
KimJ
Participant

HubL syntax for currency property?

Thanks so much for the response. I think, however, that you are showing me how to format a number as currency in the output, not how to use a currency property in a conditional statement. When I use {% if line_item.price == 0 %} there is no error in the code, but the deal-based automated email errors (template may not be found) and does not send.

0 Upvotes
TDwebdev
Contributor | Diamond Partner
Contributor | Diamond Partner

HubL syntax for currency property?

Can you share more snippet of your code, so i can see what you want to do.



Vet Digital

Did my post solve your question? Help the community by marking it as a solution
0 Upvotes