# How to keep 0001 instead of 1

**URL:** <https://forum.kirupa.com/t/how-to-keep-0001-instead-of-1/246075>\
**Category:** Uncategorized\
**Created:** [December 6, 2007, 8:53pm UTC](https://forum.kirupa.com/t/how-to-keep-0001-instead-of-1/246075 "2007-12-06T20:53:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thefisl](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@thefisl](https://forum.kirupa.com/u/thefisl)\
**Post date:** [December 6, 2007, 8:53pm UTC](https://forum.kirupa.com/t/how-to-keep-0001-instead-of-1/246075/1 "2007-12-06T20:53:55Z")

</div>

Am I retarded or is there no easy way to keep 001? I am trying to get actionscript to keep my variable as 001. Part of my solution is done as I created an if else statement to append my variable to 0 or 00 depending on how big the number is (has to be a better way…). The second part however requires that I can add 1 to this. Not working with the if else statement. I mean, what happens is that once it goes into the appending part then, it’s starts counting back? Can somebody help with this?

I have, Number = 0;

if (number\<10) {  
number = “00” + number;  
}else if (number \>10 && number \<100){  
number = “0” + number;  
}else{  
number = number;  
};  
Or something really similar. I am away from my pewter so I apologize. Please help. Thank you.
