Hi,
I have a currency datatype and along with value I would like to show currency symbol.
<table class="table borderless" style="width: 100%">
{% for d in repair_item_specification -%}
<tr>
<td class="text-muted" style="width: 30%;">{{ d.item }}</td>
<td><div>{{ d.price}}</div></td>
</tr>
{%- endfor %}
</table>
It just shows value with decimal but no symbol. What should be done?! thanks
rohit_w
2
Try
{{ d.get_formatted("price") }}
Hi rohit,
I did tried that but no success
<td><div>{{ d.get_formatted("price") }}</div></td>
TypeError: ‘NoneType’ object is not callable
rohit_w
4
format_currency(d.price, currency_name)
Set your currency in currency_name
No Luck,
{%= format_currency(d.price, “EUR”) %}
It gives error
<td><div>{%= format_currency(d.price, "EUR") %}</div></td>
TemplateSyntaxError: tag name expected
@rohit_w any pointer will be helpful. I went through all post and tried various things but no result. thanks
{{ get_currency_symbol(d.currency) }} {{ d.price }}
I’m not sure whether this is the ideal solution, but should get the work done.
<td>{%= get_currency_symbol(d.currency) %}</td>
TemplateSyntaxError: tag name expected
Are you using Jinja2 or microtemplating?
I also tried as advised
{{ get_currency_symbol(d.currency) }}
UndefinedError: 'get_currency_symbol' is undefined
It appears on html the defaults are not available whereas same works in desk