Try ERPNext Buy Support Partners Foundation

How to set from 0 value to string dash "-" format

Hi guys, need help.
I need to convert 0 value to string dash “-”

I used this code but does not work.
{% if(format_number(data[i][“paid_amount”]) === 0 )
{ %}
{%= __("-") %}
{ %}
else
{ %}
{%= format_number(data[i][“paid_amount”]) %}
{ %}
%}

try:

{% if data[i][“paid_amount”]==0 -%}
-
{% else %}
format_number(data[i][“paid_amount”]
{% endif -%}

Still not working :frowning:

is this print format ?
can you share code or screenshot

Yes, this is for print format

you dint need to write js code inside jinja!
please follow instruction bellow print format for example of using for loop in jinja
you can check this post also:

regards

I got it already :slight_smile:
{% if(data[i][“invoiced_amount”] != 0)
{ %}


{%= format_number(data[i][“invoiced_amount”]) %}

{% }
else
{ %}

{%= __("-") %}

{% }
%}