How To Keep 0001 Instead Of 1
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.
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 12-06-2007, 04:53 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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.
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.
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.
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.
I Want To Change The Number 1 In 0001
I, guys...
what do you think...
I have to do a numeric randomizer that make a selection of one number between 5820 numbers...
that's nice ... and NOT my problem...
the problem is that I have to show it inthe folowing format:
MyRandomicNumber = 12;
MyNumberToShow= 0012;
An d I have not a idea how to convert it...
If (some guy, can help me){
Im gonna be so gratefull with u;
}
|