Documate is now Gavel! Read more about why we’re excited about this rebrand.

Docassemble Word Document Templates (Part IV, Formatting Numbers)

Documate's series on Jinja for docx: How to format numbers in Jinja2 and Mako for Docassemble .docx and Word document templates.

Documate is a no-code solution to creating Docassemble document automation interviews. One of the biggest challenges to using Docassemble, the powerful document assembly platform (and more!), is knowing how to use Jinja and Mako syntaxes in your Word (.docx) documents so that you can customize your legal documents and agreements. Here, we reach you how to use Jinja in Docassemble Word templates for formatting numbers and calculations

This is Part IV of our posts about formatting your word documents. If you haven't already, check out Part I (simple variables and conditional phrases), Part II (conditional paragraphs), Part III (performing calculations).

This article will teach you how to format numbers and currency in your Word (.docx) templates. Here's an easy guide to the syntax to use to make your numbers appear in a particular way.

The "variable" is the variable name you've used in your interview.

Docassemble Documate formatting numbers mako jinja word document
Docassemble Syntax for Formatting Numbers in Word Documents (Jinja)

Edit: We told you we'll add to this articles if you ask us questions, so by popular request, here's how you can write out a full number and place it in parentheses in your document:

{{ numbers_to_words("$%.2f" | format(CurrencyNumberVariable)) }} ({{ currency(CurrencyNumberVariable) }})

This gives you, for example: One Thousand Dollars and Fifty Cents ($1,000.50).

Ask us more questions at [email protected] or in the comments below!

Documate makes it easy to create Docassemble interviews without using any code.  Documate's Word add-in is also available in the Microsoft app store for Docassemble templating of Jinja templates, which eliminates the need to use Jinja syntax on Documate.

If you haven't already, check out the rest of our Docassemble resources:

Resources for Docassemble Developers

Jinja Guide Part I: Simple variables and conditional phrases

Jinja Guide Part II: Conditional paragraphs

Jinja Guide Part III: Performing calculations

Jinja Guide Part IV: Numerical calculations

Jinja Guide Part V: Formatting words

Documate Newsletter

Sign up for our newsletter to get product updates, exclusive client interviews, and more.

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.