Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
can i please request help on how to achive the below result using tmap
Input
A134
A134
A134
B235
B235
C129
Output
A134-01
A134-02
A134-03
B235-01
B235-02
C129-01
Thanks for your help.
@rhall, you're right, you have to know the max expected length to decide if you need to add 10, 100, 1000 and so on.
From my point of view, this is the same when you use MyUtils.returnZeroPrePaddedNumber as you must decide how many leading 0 are expected.
The advantage of this routine is that there is no truncation when the input value is too large (but in that case the result is not exactly what is expected as soon as a fixed length is required).
There is no perfect solution @TRF given the information we have. I just tried to make it a bit more flexible by setting a minimum length. The assumption being that numbers will not need to be truncated, but that you may always want at least 2 digits, for example.