Amount in Words

Hello,

I’ve inserted many “currency” custom fields and it’s required to also have “amount in words” for everyone of them. I found this code Código en JavaScript que convierte números a letras, bastante útil para formularios de documentos contables y similares · GitHub but just can figure how to use it on a custom script and apply it to many custom fields on the same doctype.

Could you please give me hand? It’s really important.
(I’m using Frappe Cloud)

1 Like

Not sure how to use a custom script, but the following jinja code works in the print format:

{{ frappe.utils.money_in_words(doc.base_paid_amount or doc.base_received_amount) }}

2 Likes

I think there’s a Frappe utility for this that I swear I’ve read in the documentation. Just tried searching and came up empty. I remember it being similar to the “pretty dates” JS port.

The problem using “.money_in_words” is that place “MXN” (as currency) before the amount in words.

But searching, I found that it’s also available frappe.utils.data.in_words https://frappe.github.io/frappe/current/api/utils/frappe.utils.data

Solved. Thanks @cpurbaugh!!

2 Likes