Skip to main content
PAD_LEFT

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

Updated over 2 weeks ago

Description

The PAD_LEFT() function is used to add padding characters to the left-side of a text, ensuring it reaches a specified length. This is particularly useful for formatting purposes, such as aligning text or ensuring consistent lengths for numeric values.

Syntax

PAD_LEFT(text, length, character)

Output

text

Variables

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

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

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

Example

PAD_LEFT(`Column 1`, 8, "0")

Column 1

PAD_LEFT

42

00042

7

00007

123

00123

Did this answer your question?