0001 - How?

I was once a designer. I have evolved or de-volved, depending on perspective into a programmer.

I am now a programmer who writes about 300 lines of code to make something happen that a worthy programmer could do in about 3.

As I continue my (d?) evolution, I’d like to know if there is a simple way to
create an integer as 0001 and compare it to 0010 (ten being greater than 1) and preserve its format in this comparason.

0001 != 1
0010 > 0001
++0009 = 00010
++0099 = 0100
etc.

:alien2: pseudo coding:
I wish I could use something like Math.fill(1,4) = 0001

In mysql, you can use fill to accomplish this, and set the precision to 4.

How, without lines of spagetti programming, would this be accomplished in ActchungScript?

For some reason, my “how to” does not include it.