Formatting a number
In Weagree’s contract automation wizard it is possible to enforce number formatting (i.e. that all numbers are neatly formatted, separating thousands and decimals correctly and consistently).
Contract automation with external integration option likely requires that the exported values (amounts and percentages) in the contract text have been entered in a plain number format. Also in Weagree’s contract lifecycle management solution, the CLM data are only searchable as a (numeral) value if they had been formatted correctly.
So, while the user must enter a numeral without thousand-separators, the contract text should present the numeral correctly: with thousand separators and with such number of decimals (two cents) as the amount or number may require. This is achieved with the calc-tag, which will contain the edit-tag followed by the formatting parameter.
The typical formatting tag applied to a user entered value will be:
[calc.Amount of the loan.([edit.Principal loan amount]).#,###.##]
The following number-formatting examples deliver the indicated results in the contract:
Format syntax | Result | Observation |
#,### | 8,316 | Most frequently used form – no decimals to occur |
#,###.#0 | 8,315.60 | Most frequently used in case of two must-have decimals |
00000.00 | 08315.60 | No thousand separators, two forced decimals (rounded) |
#####.## | 8315.6 | No thousand separators, a maximum of two decimals |
#,##0.00 | 8,315.60 | Thousand separators, with always two decimals |
#.## | 8315.6 | No thousand separators, a maximum of two decimals |
€#,### | €8,316 | Amount preceded by a euro-sign (no eurocents/decimals) |
$##0.00 | $8315.60 | Amount preceded by Dollar-sign, with two forced decimals |
0 = insert either a value or a 0 on that position
The above example assumes that the culture (language) of the template is set at “English (United States)”). Otherwise, the result will be different, depending on the applicable culture. If an amount must not be rounded but truncated, use the Truncate parameter in the calculation part.
Examples (all with template language English (U.S.)):
[calc.Example 1.(1000).#,###.##]
…Result in contract: 1,000
[calc.Example 2.(1000).0,000.00]
…Result in contract: 1,000.00
[calc.Example 3.(1).0,000.00]
…Result in contract: 0,001.00
[calc.Example 4.(1).#,###.##]
…Result in contract: 1
To apply formatting with truncation:
[calc.Example 4 truncated.(Truncate(8315.60)).#,###]
…Result in contract: 8,315
Tip for testing administrators: the WYSIWYG editor does not immediately update the changes saved in the template. Other than the clauses and Q&A questions, which load as you go, the ‘mechanics’ of a calculation tag load initially, upon (re)opening the questionnaire. So close and reopen the testing contract entry each time you make a change to a calculation.