Is there a way to show the total amount of an invo...
# advancedpdf
l
Is there a way to show the total amount of an invoice in words except for the cents which must be in xx/100 format? For example, 1,200.24 should appear as "one thousand two hundred 24/100". Thank you!
n
I don't think there's a native way, you may need to script this and store the "word" version in a custom field.
d
I don't believe that Freemarker (pdf template engine) can do this itself. However Neil's right that you would have a custom field with the "word" version for referencing by the pdf template. If your number is positive and an integer, you can get away with the formula
TO_CHAR (TO_DATE ({number}, 'j'), 'jsp')
If you also need negatives or decimals (floats), check out this SO answer: https://stackoverflow.com/a/32962625
r
Look at the checks templates, you might get a clue there since checks need to have the amount in words.
d
Looks like checks have a specific field for it (which invoices don't have 😕)
{totalwords}
n
There might well be something you can find via the console that is populating that field and "borrow" if you dig around the scripts running on that page. Could be worth a nosey and save some time.
d
good thinking ☝️
l
Thanks, everyone!