> For the complete documentation index, see [llms.txt](https://v5docs.keyfax.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v5docs.keyfax.biz/reference/expression-reference/text-expressions/padleft.md).

# PadLeft

Adds characters to the front of the databox value until it reaches the length you ask for.

The first argument is the length wanted, the second is what to pad with (a space if you leave it out).

| Expression         | Databox value | Result                 |
| ------------------ | ------------- | ---------------------- |
| `PadLeft(20, '_')` | `Please sign` | `_________Please sign` |
| `PadLeft(6, '0')`  | `429`         | `000429`               |

Padding is added a whole unit at a time, and stops as soon as the value is long enough. With a single character that lands exactly on the length you asked for. With a longer padding string it can overshoot: `PadLeft(8, "> ")` on `Note:` gives `> > Note:`, which is nine characters, because the last `>` took it from seven to nine.

A value already at or over the wanted length is returned untouched — `PadLeft` never truncates.
