syntax:functions:padstart
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| syntax:functions:padstart [2016/06/20 11:42] – created dmitry | syntax:functions:padstart [2021/08/14 22:20] (current) – [Examples] craigt | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== PadStart(text, | + | ====== PadStart(text, |
| + | Category: | ||
| - | Pads the beginning of //text// with //character// up to total width defined by //number//. | + | \\ |
| + | =====Description===== | ||
| + | This function pads the beginning of //text// with //pad_char// up to a total length | ||
| - | ^ Example | + | \\ |
| - | | padstart(' | + | =====Use cases===== |
| + | This function is useful for creating text values from numbers that require leading zeros. | ||
| + | Create fixed width datasets by padding blank spaces to the front of values in each column. | ||
| - | === See also === | + | \\ |
| - | * [[syntax: | + | =====Arguments===== |
| + | ^Argument^Type^Description^ | ||
| + | |text|Text|The text value to be padded.| | ||
| + | |pad_char|Text (a single character)|The character to append to the start of //text// repeatedly until the total string length of // | ||
| + | |total_len|Number|The total length of the result string including //text// plus all repeated instances of // | ||
| + | |||
| + | **Return value type:** Text | ||
| + | |||
| + | \\ | ||
| + | =====Remarks===== | ||
| + | //text// and // | ||
| + | |||
| + | Entering a value for // | ||
| + | |||
| + | Entering a value for // | ||
| + | |||
| + | \\ | ||
| + | =====Examples===== | ||
| + | |||
| + | padstart(' | ||
| + | |||
| + | padstart(' | ||
| + | |||
| + | \\ | ||
| + | Create a fixed-width dataset from [Col1], [Col2] and [Col3] where [Col1] must be 5 characters wide, [Col2] must be 20 characters wide, and [Col3] must be 12 characters wide: | ||
| + | padstart([Col1], | ||
| + | padstart([Col2], | ||
| + | padstart([Col3], | ||
| + | |||
| + | |||
| + | \\ | ||
| + | ===== See also ===== | ||
| + | * [[syntax: | ||
syntax/functions/padstart.1466437320.txt.gz · Last modified: by dmitry