Skip to content

String formatting

Enhancing Document Templates with String Formatting

String formatting is essential in document templates, such as reports and invoices. It enables precise customization of text appearance and content. For example, consistent capitalization of company names maintains a professional look. Additionally, string formatting simplifies calculations in financial documents, reducing the chance of errors. By using these techniques, we streamline document creation, ensuring accuracy and meeting specific formatting needs.

FunctionDescriptionUsage ExampleOutput
{{capitalize text}}Capitalizes the first letter of a string.{{capitalize "hello world"}}”Hello world”
{{capitalizeAll text}}Capitalizes the first letter of each word.{{capitalizeAll "hello world"}}”Hello World”
{{lowercase text}}Converts a string to all lowercase letters.{{lowercase "Hello World"}}”hello world”
{{uppercase text}}Converts a string to all uppercase letters.{{uppercase "Hello World"}}”HELLO WORLD”
{{number_to_words number}}Converts a number to its word representation (custom helper).{{number_to_words 42}}”Forty Two”

To use these functions, simply include them in your template with the provided syntax.