fixedwidth(
TEXT
,
WIDTH
)

The fixedwidth( function makes the text a fixed width, padding with spaces if necessary.


Parameters

This function has two parameters:

text – the original text.

width – desired number of characters.


Description

This function makes the text a fixed width. If the text is shorter than the specified width, it is padded with spaces. If the text is longer than the specified width, it is cut off.

fixedwidth("abcd xyz",12)+"tab" ☞ abcd xyz    tab
fixedwidth("abcd",12)+"tab"     ☞ abcd        tab

Note that this makes the text a fixed number of characters – it does not take variable character width based on fonts into account.

Note: This function is equivalent to:

(thetext+rep(" ",thewidth))[1,thewidth]

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.