-
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;
}
-
Senior Member
A couple of IF's will do it....
MyRandomicNumber = 12;
if(MyRandomicNumber <10){
MyNumberToShow= "000"+MyRandomicNumber ;
}
if(MyRandomicNumber >9 && MyRandomicNumber<100 ){
MyNumberToShow= "00"+MyRandomicNumber ;
}
if(MyRandomicNumber >99 && MyRandomicNumber<1000 ){
MyNumberToShow= "0"+MyRandomicNumber ;
}
if(MyRandomicNumber >999 ){
MyNumberToShow= MyRandomicNumber ;
}
-
Doo!!...
I'm really a fool... it was so clear...
thanks pellepiano
any way... I really apreciate it..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|