Fields - Formatters
You can use special formatters for Fields and Smart Fields
Quick examples:
Special Field formatter “format”
If you want format number that reflect money in some specific world format you can do that using format filter. It will allow you set following parameters:
decimal points (default: 2)
thousands delimiter (default: ',')
decimal delimiter (default: '.')
[fieldName] | format:[decimalPoints]:"[thousandDelimiter]":"[decimalDelimiter]"
Special Field formatter “toFixed”
It’s pretty common that you need to calculate the field and see the output in specific precision (especially if you calculate price/cost in some currency).
E.g. If the result of the calculation are 1.54212 > the output will be converted to 1.54. It's a simplified format function. If you want to round numbers to specific precision use the "round" filter instead.
Special Field formatter “round”
This filter works in a similar way as "toFixed" however it rounds up value to specific precision
Special Field formatter “inWords”
It’s quite common that you need your value being spelled in words on your document
E.g. If results value is 4500, output will be converted to “four thousand and five hundred”
Let’s apply this to example above to get proper USD values:
By Default inWords is set to English but it support following languages:
en (English, default)
ar (Arabic)
cz (Czech)
dk (Danish)
de (German)
es (Spanish)
fr (French)
fa (Farsi)
he (Hebrew)
hu (Hungarian)
id (Indonesian)
it (Italian)
ko (Korean)
lt (Lithuanian)
lv (Latvian)
nl (Dutch)
no (Norwegian)
pl (Polish)
pt (Portuguese)
ru (Russian)
sr (Serbian)
tr (Turkish)
uk (Ukrainian)
zh (Chinese)
Special Field formatter "date", "time"
You can display provided time or date in format you desire in output document (if Date is provided in format that could be parsed).
It supports two optional parameters:
{ field | date:'[format]' : '[timeZone]'}
{ field | time:'[format]' : '[timeZone]'}
format [optional] - output format using language code (12 hours vs 24 hours etc.) - Examples: en-US, en-GB, fr-FR, de-DE, pl-PL, es-ES, it-IT | Default: 'en-US'
timeZone [optional] - timezone in Intl format - Examples: America/Chicago, Europe/Berlin, Europe/Warsaw, Europe/Rome | Default: 'Universal' UTC Timezone See list of Available Timezones:
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Examples for date:
If incorrect format / timezone will be provided Documentero will use default values.
Special Field formatter "capitalize", "uppercase", "lowercase"
You can use one of "capitalize", "uppercase", and "lowercase" filters if you want to change the formatting of text to uppercase or lowercase. You can make only first letter uppercase using capitalize. Check examples below:
Special Field formatter “hide"
You can use "hide" filter if you want to hide field output on regular field. Useful if you need to use field value withing Smart Fields or Smart Sections but you don't want to show actual value in the document
Last updated