fix: Decimal point issue for e-invoice

This commit is contained in:
Rohit Waghchaure
2019-09-16 14:49:30 +05:30
parent 2a3c62e7f6
commit 778d7b9cbd

View File

@@ -1,5 +1,11 @@
{%- macro format_float(value, precision=2) -%}
{{ value|round(frappe.utils.cint(precision)) }}
{%- if frappe.utils.cint(precision) == 3 %}
{{ "%.3f" % value|abs }}
{%- elif frappe.utils.cint(precision) == 4 -%}
{{ "%.4f" % value|abs }}
{%- else -%}
{{ "%.2f" % value|abs }}
{%- endif %}
{%- endmacro -%}
{%- macro render_address(address) %}