Variable Formatting

Some variables are provided with formatting options that allow you to specify the format of the output.

Date

The date format option allows you to specify what form the dates are output.

{variable | date:'format'}

Where variable is one of the variables and format specifies the format of the date. For example:

{rfq.createdAt | date:'MM DD, YYYY'}

Refer to Moment.js for more date formats.

Boolean

The boolean format option allows you to use a boolean operator to output customized text.

{variable | bool:'true value': 'false value': 'N/A value'}

Where variable is one of the variables. For example:

{rfq.properties['is approved'] | bool:'Y': 'N'}
{rfq.properties['is approved'] | bool:'GOOD': 'BAD': 'NA'}

Create a checkbox for custom attributes example:

{rco.properties["checkbox3-1"]| bool : “☒”:”☐”}

Number

The number format option allows you to specify the form of numerical outputs.

{variable | number:'decimal points': 'group separator': 'fraction separator'}

Where variable is one of the variables, decimal points specifies the number of decimal points after the fraction separator, group separator specifies the symbol to use for the group separator, fraction separator specifies the symbol to use for the fraction separator. For example:

{rco.approved | number:'2': ',': '.'}

would return a number such as 10,050.89.

You may add written currency to the number format variables by using the format writtenCurrency:'USD'. For example:

{contract.awarded | writtenCurrency:'USD'}

where you can replace USD with the actual currency of the awarded contract.

Math Functions

Math functions and rounding can be applied to variables on documents. Add, subtract, multiply, and divide are all supported.

Examples:

{rfq.approved | add: 1}

{rfq.approved | minus: 2} 

{rfq.approved | multiply: 1.13} 

{rfq.approved | divide: 1.1}

Math and rounding example example:

{rfq.approved | divide: 1.5 | rounding: '0.1': 'half-up'}

You can also create more advanced math variables, which may be helpful when working with document templates for payment applications. For example:

Variables Description
{ previousQuantity | add: quantity | rounding: '0.01': 'half-up' } Returns Total to Date Quantity of the payment application
{ previousAmount | add: amount | rounding: '0.01': 'half-up' } Returns Total to Date Amount of the payment application
{ payment.lineView.totalPreviousAmount | add: payment.lineView.totalAmount | rounding: '0.01': 'half-up’ } Returns Grand Total Amount of the payment application

Text

The text format options allow you to control the case of the word output by the variable.

{variable | case}

Where variable is one of the variables and case represents one of the following:

For example:

{owner.name | uppercase}

Returns the owner company name in all caps.

Composite

The composite format option allows you to combine two other formats.

{variable | format1 | format2}

Where variable is one of the variables and format1 and format2 represent two different format options from above. For example:

{rco.approved | written | uppercase}

Sorting

When you have a list or collection of data, you can sort it in either ascending (asc) or descending (desc) order by number.

Use the following format:

{#variable | sortBy:'number':'order'} {/variable | sortBy:'number':'order'}

For example:

{#oco.pco | sortBy:'number':'asc'} {/oco.pco | sortBy:'number':'asc'}