ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

How to format amounts correctly depending on currency format

jinja

#1

Hello,

I customized the print format of the quotations. In it, I have instructions like this;

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

On the other hand, I have this currency format definition for CLP:

#.###

If quotation currency is set to CLP, how to make the “get_formatted” call to respect the currency format definition?

Currently, amounts are displayed this way: “000.000,00”

That problem has more impact when the net amount + taxes makes it to result a non integer value, for example, if total amount, after taxes applied, results 123456.78, I need it to be displayed as “123.457”.

Any help, please?

Regards
Jaime


#2

I have a simple jinja file/format here, which includes a bit of number formatting - hopefully it’ll help