How to use frappe.utils.money_in_words

I want to have the amount displayed both in words and in number. I have searched but am not getting something which is clear. Help please!

When in doubt, look at the existing code for hints:

I have tried this code but not getting the amount in word! would you help me to resolve the issue?

Can you share what you tried?

Here’s an example:

In print format, enter the following in HTML:

{{ frappe.utils.money_in_words(doc.grand_total) }}

This will reflect on your print format as follows:

1 Like

I want to do this in custom script or in material_request.py file to show the in word in the form view. I have tried the following in the .py file

def set_total_in_words (self):

from frappe.utils import money_in_words

from erpnext.setup.utils import get_company_currency

if self.company:

    company_currency = get_company_currency(self.company)

    self.in_word = money_in_words(self.total, company_currency)

here in_word is the field where i want to show the in word of the total field.

For money_in_words both js and php script are required. I have solved my problem. thanks the forum members who tried to give solution! Because from one post from one of the forum members gave me the idea!

1 Like