Use the [formatnumber] function to flexibly format numbers in ChiliDocs — including decimals, separators, and optional currency symbols.
In many use cases, numbers should not be displayed raw, but formatted — for example with custom thousand separators, a specific number of decimal places, or even a currency symbol. With the formatnumber
function identifier, you can now flexibly format numbers directly in ChiliDocs Word templates.
Example with a numeric field from a deal:
[deal.amount(formatnumber:d=2;ds=,;ts=.;c=true)]
Parameter Overview
Short Key | Description | Example Value |
d |
Number of decimal places | 2 |
ds |
Decimal separator | , |
ts |
Thousand separator | . |
c |
true to show the currency symbol |
true |
đź’ˇ Tip: If you prefer more descriptive parameter names, you can also use these long-form equivalents:
Long Form | Equivalent |
decimals |
d |
decimalSeparator |
ds |
thousandSeparator |
ts |
currency |
c |
Example using long-form parameters:
[deal.amount(formatnumber:decimals=2;decimalSeparator=,;thousandSeparator=.;currency=true)]
Output Examples
Input value: 32599.5
, currency: EUR
Placeholder | Output |
[deal.amount(formatnumber:d=1)] |
32599.50 |
[deal.amount(formatnumber:d=2;ds=,;ts=.)] |
32.599,50 |
[deal.amount(formatnumber:d=2;ds=,;ts=.;c=true)] |
€32.599,50 |
Notes
-
Parameters can be specified in any order, separated by semicolons
;
. -
If no
d
value is set, the original decimal format will be preserved. -
The currency symbol will only be shown if
c=true
(orcurrency=true
) is used. -
The currency code is automatically pulled from context (e.g., deal, line item, or account), similar to
format:currency
.
Default Behavior (if nothing is specified)
Parameter | Default |
d |
unchanged decimal places |
ds |
. |
ts |
, |
c |
false |
This allows you to format amounts, numeric fields, or percentages exactly the way your audience or regional standard requires — all from within your Word template.