This Action Block is made to pad any integer or decimal number with any single character on the left side of the integer part. The decimal part (if any) can also be padded with zeros (0) on the right side.
INPUT variables:
• Number: string variable containing the number to be padded
• PaddingChar: single character used to pad on the left side (leading padding). Default: 0 (zero)
• LengthLeading: number of characters to pad on the left side. 2≤LengthLeading≤20 (default: 2)
• LengthTrailing: number of zeros (0) to pad on the right side of a decimal number. 0≤LengthTrailing≤20 (default: 0)
OUTPUT variable:
• PaddedNumber: returns an empty string if Number is not a regular number.
If PaddingChar is 0 (zero), the minus sigh (-) of negative numbers remains on the left side. Otherwise (non-zero padding character), minus sign (-) will be added after the rightmost position and a space will take place of the minus sign (-) for positive numbers.
Enjoy!
INPUT variables:
• Number: string variable containing the number to be padded
• PaddingChar: single character used to pad on the left side (leading padding). Default: 0 (zero)
• LengthLeading: number of characters to pad on the left side. 2≤LengthLeading≤20 (default: 2)
• LengthTrailing: number of zeros (0) to pad on the right side of a decimal number. 0≤LengthTrailing≤20 (default: 0)
OUTPUT variable:
• PaddedNumber: returns an empty string if Number is not a regular number.
If PaddingChar is 0 (zero), the minus sigh (-) of negative numbers remains on the left side. Otherwise (non-zero padding character), minus sign (-) will be added after the rightmost position and a space will take place of the minus sign (-) for positive numbers.
Enjoy!