The FormatText function is a built-in function that builds a Text output of the specified Text value, by limiting it to the specified max_chars count. If value has less than the min_chars character limit, enough padding_char characters are added to expand the length to that limit. In this case, left_padding determines where the padding should be added.

Input parameters

value: Text Type

min_chars: Integer Type

max_chars: Integer Type

left_padding: Boolean Type

padding_char: Text Type

Output parameters

Text Type

Examples

Usage

Result

FormatText( "123456789", 3, 9, true, "#" )

"123456789"

FormatText( "123456789876", 3, 9, true, "#" )

"456789876"
FormatText( "123456789876", 3, 9, false, "#" )

"123456789"

FormatText( "12345", 10, 20, true, "#" )

"#####12345"

FormatText( "12345", 10, 20, false, "#" )

"12345#####"

See Also

Available Formatting Functions | Available Built-in Functions