The Daily Click ::. Forums ::. Klik Coding Help ::. Converting Numbers to Strings of Specific Length
 

Post Reply  Post Oekaki 
 

Posted By Message

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
13th December, 2004 at 22:44:37 -

Is there any way (or an extension) to convert a number to a string of a specific length in a single event?
For example, change "3" to "003". Its not a major problem, but it would be handy for something I'm trying at the moment.

 
n/a

醤油の兵士

Almost Human

Registered
  12/06/2002
Points
  173

VIP Member
13th December, 2004 at 22:56:07 -

String Manipulator can, or you can use:
Left("000",3-Len(Str$(A_Value))) + Str$(A_Value)

 
As a boy, I wanted to be a train. I didn’t realize this was unusual—that other kids played with trains, not as them.

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
14th December, 2004 at 14:32:17 -

Thanks very much! I dont like to use extensions unless I really have to, but you other solution is ideal.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click