Copy link to clipboard
Copied
I get why in the following example when adding "003" + 1 = 0031 because it's a string concatinating with a number. So adding a number with a number gets the proper result of "4".
My question is two parts:
INC_301_501_ptv_v001.aep
INC_301_501_ptv_v002.aep
I can't leave it as just v1, v2, v10 as clients make it a requirement for sorting purposes.
Here is the detailed answer to your second question (extending a number like "12" to 0012.
Attached you find a function which does exactly that. The example here will alert "0012"
Also note that this function works no matter if the argument "number" is a number or a text. But it won't trancate the numbers. So if you try to bring 99999 to a length of 3 it will return the 99999 unchanged.
Copy link to clipboard
Copied
For the first part of the question: the "round" block in the math category can for example be used to convert a text to a number. This sample code first alerts "4" and then "5":
To get this back into a 0 padded string you need to check its length with the "length of" block and add 0 as necessary.
Copy link to clipboard
Copied
Here is the detailed answer to your second question (extending a number like "12" to 0012.
Attached you find a function which does exactly that. The example here will alert "0012"
Also note that this function works no matter if the argument "number" is a number or a text. But it won't trancate the numbers. So if you try to bring 99999 to a length of 3 it will return the 99999 unchanged.
Copy link to clipboard
Copied
As always, your is a far superior solution. Just so you know, I really am trying to figure this stuff out and this is what I had come up with before you posted your second reply.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more