/
7.8 Document Template Mergefield Formatting Options

7.8 Document Template Mergefield Formatting Options

This lesson will show you how to apply different formats to your mergefields when creating a document template. To apply a format to a mergefield, simply enter it as shown in the examples.

Date Formats

 

  •   { MERGEFIELD CurrentDate } = 31/10/2012
  •   { MERGEFIELD CurrentDate \@ "MM-dd-yyyy" }= 10/31/2012
  •   { MERGEFIELD CurrentDate \@ "dd-MMM-yyyy" }= 31-Oct-2012
  •   { MERGEFIELD CurrentDate \@ "dd.MM.yyyy" }= 31.10.2012
  •   { MERGEFIELD CurrentDate \@ "dd MMMM yyyy" }= 31st October 2012

 

This list shows examples of a date mergefield in different formats.

As you can see, the standard format without a string is 31/10/2012. "\@" is used to indicate that a format string follows, Format strings allows you to change the format of the field, for example MM.dd.yyyy will display 10.31.2012 whilst dd-MM-yyyy will display 31-10-2012.

The month part of the date functions slightly differently as two "M"s will display the month numerically, four will display it in full as text and three will display abbreviated text.

Time Formats

 

  •   { MERGEFIELD CurrentTime }= 21:00
  •   { MERGEFIELD CurrentTIme \@ "h:mmAM" }= 9:00AM
  •   { MERGEIFLED CurrnetTime  \@ "HH:mm" }= 21:00

 

Time formats are very similar to dates but use "m" to signify minutes and "h" to signify hours. two capital "H"s will use 24 hour time whilst a single lowercase "h" with "AM" or "PM" at the end of the format will use 12 hour time.

Financial Format

 

  •   { MERGEFIELD Case.Custom.AmountOfLoan \# "$#,##0.00" }= $1,099.50

 

This numeric format ensures that character placement is correct for financial figures and allows you to display the field in your currency of choice by inserting the appropriate symbol. copying this format string will ensure all currency fields are displayed correctly.

Related content