ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Random Money Serial Number Generator

FAQ   •   VIEW ALL
 Random Money Serial Number Generator on Oct 3, 2019 at 9:38:53 pm

I'm trying to build a random number counter to give the effect that you're looking at a bunch of money serial numbers.

So something like this

``` letter = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N"] reserve = ["A1","B2","C3","D4","E5","F6","G7","H8","I9","J10","K11","L12"] serial = random([0,9][0,9][0,9][0,9][0,9][0,9][0,9][0,9]])[0] ["letter" + "reserve" + serial] ```

Obviously this is doing nothing now, but hopefully it conveys what I'm trying to accomplish.

 Re: Random Money Serial Number Generatoron Oct 3, 2019 at 10:30:18 pm

I'm sure this isn't nearly as efficient as it could be, but it works:

``` rate = 1/0.05; posterizeTime(rate) var letters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N"] var countLetters = letters.length; var currentLetter = random(0, parseInt(countLetters)); number1 = random(0,9).toFixed(); number2 = random(0,9).toFixed(); number3 = random(0,9).toFixed(); number4 = random(0,9).toFixed(); number5 = random(0,9).toFixed(); number6 = random(0,9).toFixed(); number7 = random(0,9).toFixed(); number8 = random(0,9).toFixed(); [letters[parseInt(currentLetter)]+number1+number2+number3+number4+number5+number6+number7+number8] ```

 Re: Random Money Serial Number Generatoron Oct 4, 2019 at 9:21:25 pm

```could do a for loop, clean up some of the redundant variables. Also length will always be 1 longer than the final array cell, so you need to subtract one (first cell is always cell[0]). ```

Alex Printz
Mograph Designer

 Re: Random Money Serial Number Generatoron Oct 4, 2019 at 9:21:41 pm

I butchered that last post.

```rate = 1/0.05; posterizeTime(rate); var letters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N"] serial = String(letters[random(0, letters.length-1)]); for(i=1;i&lt;=8;i++) serial = serial + String(Math.floor(random(0,9))); serial```

Alex Printz
Mograph Designer