Hi,
We have a requirement to generate a document which contains some information of a user that needs to be encoded by the guidelines provided. We need to format the value in such a way that it's length remains fixed always which is provided to us. So any value which has less digits than the required number of digits should be formatted like for eg: If the input is 1250000 and the max limit is 20, then it should be encoded as 00000000000001250000.
How can we do that, thanks in advance.
Discussion posts and replies are publicly visible
text() function is a perfect match for you
text(ri!value, concat(repeat(ri!limit, 0)))
Check out text() for more details.
Or, even shorter:
text(ri!value, rept("0", ri!limit))
In case that "value" is longer or alphanumeric you might want to use this:
concat( rept("0", ri!limit - len(ri!value)), ri!value )
Cool, didn't knew about that.