PlaceholdersParsers
Padding Parser for Placeholders
Pad text in a Tickety placeholder to a fixed length with a character of your choice, on the left, the right or both sides, with every parameter and examples.
Usage
To use the parser, insert the following syntax in your text:
{padding(length:padChar:direction):text}
- You can also reference this parser using the alias: pad
Examples
- Left padding (default):
- Input:
{pad(4):42} - Output:
0042
- Custom padding character:
- Input:
{pad(4:*):42} - Output:
**42
- Right padding:
- Input:
{pad(4:0:right):42} - Output:
4200
- Center padding:
- Input:
{pad(4:-:both):42} - Output:
-42-
Available Parameters
| Parameter | Description | Default | Example |
|---|---|---|---|
| length | Target length for the string (required) | - | 4 |
| padChar | Character used for padding | "0" | * |
| direction | Padding direction: "left", "right", or "both" | "left" | right |
Notes:
- If the text is already equal to or longer than the specified length, it will be returned unchanged
- For "both" (center) padding, if the padding cannot be distributed evenly, the extra padding character will be added to the right side
Truncate Parser
Limit the length of text in a Tickety placeholder by cutting off the excess characters and adding an ellipsis, with the usage, its alias and examples.
Number Parser
Format numbers in Tickety placeholders for reading, with thousands separators or a shortened form, plus every available style, examples and notes.