Syntax

pad(<subject>, <desiredLength>[, <padCharacter>, [left|right]])

put pad("15.00", 8, "0") into leftPaddedPrice
put pad(pageTopic, 30, "…", right) & pad(pageNumber, 3) into tocEntry

Explanation

The pad function fills up a string to the specified length by adding padding characters.

Parameters

subject

The text to be padded to the given length

desiredLength

The length to pad the string to.

padCharacter

The character to use for padding. If this is missing or empty, defaults to padding with spaces.

left|right

Whether the padding should be inserted at the left or right of the string. If you do not specify anything here, the function will behave as if you had written left.