HotDocs Models: format( value, "example" )

Placeholder Replace With
value Any Number, Date, or True/False variable
"example" A format example (in quotation marks) you want used with the value. Must be in a format HotDocs can recognize.   

Sometimes you may need to add a date, number, or true/false value to a text value. You can do this by formatting the date, number, or true/false value as text.

For example, perhaps you want to create a list of items with their associated monetary values. Because these two values are different in nature, they cannot be added together without first representing the number value as a text value:

""

repeat ItemsPurchasedList

result + ItemName+ ", " + format( ItemAmount, "$9,999.00" ) + "

"

endRepeat

In this script, HotDocs first sets the computation value to nothing. Then HotDocs repeats ItemsPurchasedList and then places the answers for both ItemName and ItemAmount (which is formatted to appear as a text value) in the same text string, separated by a comma. If ItemsPurchasedList is answered more than once, HotDocs manually inserts a hard return (as shown before the endRepeat) to create a column of amounts.