Precision Issue in Print Format using Jinja

I had added the below code in print format using jinja but i am finding precision issue as you can see clearing in the picture in am justing 01 precision but the actual value had 02 precision any one can help me in this regards.

Sales Invoice

{{doc.status}}

Customer Name:
{{ doc.customer_name }}
Customer NTN:
{{ doc.tax_id }}
Customer Address:
{{ doc.customer_address }}
PO Number
{{ doc.po_no }}
    <div>
        Invoice Number :<br>
        <b>{{ doc.name }}</b><br>
        Posting Date:<br>
        <b>{{ doc.posting_date}}</b><br>
        Payment Due Date:<br>
        <b>{{ doc.due_date }}</b><br>
        PO Date:<br>
        <b>{{ doc.po_date }}</b>
    </div>
</div>
{% for item in doc.items %} {% endfor %}
Description Quantity Rate Amount
{{ item.get_formatted(item_name) }} {{ item.qty }} {{ item.get_formatted(rate) }} {{ item.amount }}

{{ doc.terms }}
Total:
Discount:
   {% for tax in doc.taxes %}
   
          {{ tax.account_head }}

      
    {% endfor %}
 
    Total:<br>
</div>
<div style="margin-left: auto;">
    <b>{{ doc.total }}<br>
    -{{ doc.discount_amount }}<br>
    <b>

   {% for tax in doc.taxes %}
   

            {{ tax.tax_amount }}
    
      
    {% endfor %}</b><br>
    {{ doc.grand_total }}<br></b>
</div>


Hi @Mohtashim_Shoaib ,

You can use syntax like {{ ‘{0:0.2f}’.format(row.qty) }. 2f means it will show you a ex. 10.00 value. If you do 4f then 10.0000 will print.

For currency values try the following
frappe.utils.fmt_money(tax.tax_amount, currency=doc.currency)

If you don’t want the currency symbol, omit the currency parameter in the method.

@Void_Moon Thanks its works

Hi @Mohtashim_Shoaib,

You can also use the get_formatted

{{doc.get_formatted("grand_total")}}

I hope this helps.

Thank You!

Yes this help me alot thanks