Special Formatting

While most text formatting can be applied directly to the placeholders, and the formatting will be passed on to the generated text, some formatting options can only be applied once the content is available.  These formatting options are incorporated directly into the placeholder field code.

 

 

Applying Number, Date, and Time Formats

To change the formatting of numbers and dates during document generation, the formatting codes are inserted into the field code.

 

1.   See the section on Inserting Placeholders Into Document Templates for instructions on finding and inserting placeholders.  When the placeholder is inserted, it will appear as follows:

 

<<FieldName>>

 

2.   In order to configure the placeholder, the field codes must be displayed.  Press Alt+F9 to enter "Edit Mode", displaying the structure of the field.  The field will appear as follows:

 

{ MERGEFIELD FieldName }

 

3.   Immediately after the FieldName, enter a single space followed by the format code.  A variety of common format codes for numbers and dates are listed in the tables below.

 

{ MERGEFIELD FieldName \##,##0.00 }

 

Example number format codes:

 

{ MERGEFIELD Number \# 00000 }

00023

{ MERGEFIELD Number \# 000.00 }

023.00

{ MERGEFIELD Number \# #,##0.00 }

32,113.10

{ MERGEFIELD Number \# $#,##0.00 }

$32,113.10

{ MERGEFIELD SocSec \# 000'-'00'-'0000 }

123-45-6789

{ MERGEFIELD Number \# "$,0.00;($,0.00) }

$3,210.00  (in parentheses if negative)

{ MERGEFIELD Phone \# "(000) 000'-'0000" }

(336) 123-4567

{ MERGEFIELD Percent \# "0.00%" }

1.50%

 

Example date and time format codes:

 

{ MERGEFIELD Date \@ "M/d/yyyy" }

4/1/2014

{ MERGEFIELD Date \@ "MM/dd/yyyy" }

04/01/2014

{ MERGEFIELD Date \@ "MMM d, yyyy" }

Apr 1, 2014

{ MERGEFIELD Date \@ "MMMM d, yyyy" }

April 1, 2014

{ MERGEFIELD Date \@ "ddd, d-MMM-yy" }

Fri, 1-Apr-14

{ MERGEFIELD Time \@ "h:mm" }

3:05

{ MERGEFIELD Time \@ "h:mm am/pm" }

3:05 pm

{ MERGEFIELD Time \@ "hh:mm 'EDT'" }

03:05 EDT

{ MERGEFIELD DateTime \@ "MMM d, yyyy, h:mm am/pm" }

Apr 1, 2014, 3:05 pm

 

4.   Right-click anywhere within the field and select Update Field.

 

Warning:  If you do not “Update Field”, all changes to the field configuration will be lost as the field will revert to default values when you save your document.

 

5.   Press Alt+F9 to exit "Edit Mode".  The field codes are hidden and the placeholder will appear as it was when it was inserted.