Skip to main content
PAD_RIGHT

Pads the right-side of text with a specified character to ensure a minimum text length

Updated over 2 weeks ago

Description

The PAD_RIGHT() function is used to add padding characters to the right-side of a text, ensuring it reaches a specified length. This is particularly useful for aligning text or creating formatted text, such as aligning text labels or creating fixed-width strings.

Syntax

PAD_RIGHT(text, length, character)

Output

text

Variable

  1. text: The original text value that you want to pad.

  2. length: The desired total length of the resulting string after padding.

  3. character: The character used for padding. This should be a single character.

Example

PAD_RIGHT(`Column 1`, 5, "*")

Column 1

PAD_RIGHT

42

42***

7

7****

123

123**

Did this answer your question?