pad

padMicronode

Widens text to a fixed length by repeating a filler character. Text already at or beyond the length is unchanged.

Explained in:Functions

#Attributes

lengthRequiredImplicit
The length to pad up to.Can be written as shorthand: pad:value
with
The filler. Absent or empty, it is one space — a string value is trimmed and cannot carry one.
Default
side
startend
Which end the filler goes on: start or end.
Defaultstart

#Allowed content

Body { }Inline Chalk content, flattened to plain text

#Examples

!pad:6{42}(with: 0)

#Notes

  • !pad:6{42} gives 42; !pad:6{42}(side: end; with: .), 42....; !pad:6{42}(with: 0), 000042.
  • The filler is trimmed by the attribute parser and so cannot be a space — which is why an absent or empty with means one space.