01/15/2025. A numeric figure might need commas, a currency symbol, or to be written out as words. This page collects all of the formatting functions available for dates, numbers, words, and special number patterns so you can find what you need quickly. Copy the syntax directly into your Word template, replacing variablename or DateVariable with your own variable name.
All formatting shown here uses double curly brackets
{{ }} and is placed directly in your Word or PDF document template — not in the questionnaire builder.Formatting dates
Date formatting is applied with theformat_date() function. The first argument is your date variable; the second is the format string.
Display formats
| Output example | Syntax |
|---|---|
| January 10, 2020 (default) | {{ DateVariable }} |
| Today’s date | {{ format_date(today()) }} |
| Saturday, January 10, 2020 | {{ format_date(DateVariable, format='full') }} |
| 1/10/20 | {{ format_date(DateVariable, format='short') }} |
| 01/01/2020 | {{ format_date(DateVariable, format='MM/dd/yyyy') }} |
| 1/01/2020 | {{ format_date(DateVariable, format='M/dd/yyyy') }} |
| 10/01/2020 (day/month/year) | {{ format_date(DateVariable, format='dd/MM/yyyy') }} |
| January ___, 2020 | {{ format_date(DateVariable, format='MMMM ____, yyyy') }} |
| 01012020 | {{ format_date(DateVariable, format='MMddyyyy') }} |
| 30Nov20 | {{ format_date(DateVariable, format='ddMMMyy') }} |
| Just the year: 2020 | {{ format_date(DateVariable, format='yyyy') }} |
Ordinal date phrasing
Legal documents frequently require dates written as “the 15th day of January 2025.” Use this pattern:Converting text to a date
If you are importing data from another system (such as Clio) where the date field arrives as plain text rather than a date type, useas_datetime() with strftime to convert it:
%-d instead of %d to suppress the leading zero (e.g., “January 3” instead of “January 03”).
Formatting dates using Calculations (Invisible Logic)
You can also format a date variable through Calculations. Create a new Text variable, select your date variable as the source, choose Format Date as the operation, and enter the format code. The resulting text variable can then be referenced anywhere in your document with{{ FormattedDateVariable }}.
Calculating dates
These functions derive new date values from existing ones — useful for deadlines, notice periods, and age calculations.Age or years elapsed from a date to today
Age or years elapsed from a date to today
Years between two specific dates
Years between two specific dates
Months between two dates
Months between two dates
Add or subtract calendar days, months, or years
Add or subtract calendar days, months, or years
years with months, days, or weeks. Use - instead of + to go back in time.Add or subtract business days
Add or subtract business days
Next or prior business day
Next or prior business day
Last day of a month
Last day of a month
Formatting numbers
Use a Number question type for decimal values and an Integer question type for whole numbers. Apply the functions below in your document template.If you use a Number question type, decimal points display by default. If you use an Integer question type, you get a whole number.
Standard number formats
| Output example | Syntax |
|---|---|
| $100,000.00 | {{ currency(variablename) }} |
| 100000 (no commas, no decimals) | {{ Decimals0NoCommas(variablename) }} |
| 100,000.00 | {{ Decimals2Commas(variablename) }} |
| 100,000 | {{ Decimals0Commas(variablename) }} |
| Custom decimals with commas | {{ format_decimal(variablename, 2) }} |
| Custom decimals without commas | {{ format_decimal(variablename, 2, False) }} |
2 in format_decimal with the number of decimal places you want.
Ordinal numbers
Write a number as an ordinal (1st, 2nd, 10th, etc.):Numbers written as words
Convert a number to its written-out English form (recommended with the Integer question type):International number formatting
Rounding in document templates
Round down (floor) to two decimal places:Formatting special numbers
Usenumber_custom() to force specific punctuation patterns on any number. Have the client enter the value as a Number question type, then apply the mask in your template using n for each digit position.
- Phone numbers
- EINs
Formatting words
These functions control capitalization and text transforms. If you want the output to match exactly what the client typed, you do not need any of the functions below.Case transforms
| Output example | Syntax |
|---|---|
| APPLE (all caps) | {{ variablename|upper }} or {{ variablename.upper() }} |
| Apple And Pear (title case) | {{ title_case(variablename) }} |
| Apple and pear (capitalize first only) | {{ capitalize(variablename) }} |
| apple (all lowercase) | {{ variablename|lower }} or {{ variablename.lower() }} |
Articles and plurals
Add “a” or “an” before a variable automatically:variablename is an Integer. Output: 1 apple / 3 apples
Punctuation
Add a trailing period only when the text does not already end with one (useful for company names):Verb conjugation
To conjugate a verb based on whether one person, multiple people, or a third-party singular is acting:- Create a multiple-choice question with variable name
conjugationand choices:1sg,3sg,pl. - Use this syntax in your template (replacing
allegewith your verb):
Formatting text area questions
Text area variables require special handling to preserve line breaks in the output.| Goal | Syntax |
|---|---|
| Preserve line breaks | {{ variablename | manual_line_breaks }} |
| Output as a numbered list | {%p for line in VariableName.split("\n") %}{{ loop.index }}. {{ line }}{%p endfor %} |
| Output as a bulleted list | - {%p for line in VariableName.split("\n") %} then - {{ line }} then - {%p endfor %} |
| Join lines with commas | {{ commalist(VariableName.split("\\n"), "<__str__()>", "") }} |
Accepting or rejecting variables in Gavel Blueprint
When you upload a document to Gavel Blueprint, the AI identifies variable placeholders in your template and suggests questions for each one. You review these suggestions and either accept or reject each proposed variable.Review variables in the sidebar
After uploading your document, scroll through the content or use the variable sidebar. Blueprint highlights each location where it detected a variable.
Accept or reject each variable
Accept variables that correspond to genuine client-provided data. Reject any that Blueprint identified incorrectly — for example, static text it mistook for a placeholder.
Generate the draft workflow
Once you have reviewed all variables, click Draft Workflow. Gavel generates a first draft of the workflow, including all accepted variables as questions. You can then edit question wording, types, and order in the builder, and use the Word add-in or PDF Tagger to fine-tune the template markup.
