Module transformers

Source

Functionsยง

apply_tranformers
Applies any tranformations to the variable, you can chain the transformers called whenever you use VAR_TRANSFORM_SEP_CHAR to provide a transformer in the template.
bound
Gets the bound of a rust range object
calc
Airthmatic calculations, the value needs to be float. e.g. {val:calc(+1)} will add 1 to the value. The order of calculation is left to right.
comma
Insert commas to the given string in provided positions
count
Count the number of occurances of a pattern in the string. You can chain it with calc to get the number of word like: {val:count( ):calc(+1)}
float_format
format the float (numbers). For example with val=1.123, {val:f(2)} or {val:f(.2)} gives 1.12
group
Insert characters to the given string in provided positions
quote
Quote the text with given strings or ""
replace
Replace text in the string, by another text
string_case
Format the string. Supports up=> UPCASE, down=> downcase, proper => first character UPCASE all others downcase, title => title case according to titlecase::titlecase. e.g. {var:case(up)}.
take
Split the text with given separator and then take the Nth group
trim
Trim the given string with given patterns one after another