Two ways to do this through expressions:
stringFormat("%s%s%s",
"Label",
repeat("-", 50 - (len("Label") + len("$2500"))),
"$2500"
)
replace(stringFormat("%-45s%s",
"Label",
"$2500"
), " ", "-")
I like the latter a bit more, myself - no need to specify your different elements multiple times. Java’s string formatting operators let you enter a fixed amount of padding (that is, %-20s
will add spaces to the right of the string until it hits 20 characters), which you can then use to pad out your string. Then just append your currency value to the end.