The Daily Click ::. Forums ::. Klik Coding Help ::. Adding Zeros in front of a Number

Post Reply  Post Oekaki 

Posted By Message

The New SnS

25th March, 2005 at 19:35:21 -

I'm making a program that copies and renames files in a sequential order and I need to figure out how to make it so that in a quickloop (MMF not using the object) a certain number of zeros are added in front of a file. Ex. 001, 002... 009, 010, 011... 099,100,101... Is there any way of doing this in MMF 1.5?

Visit the home of Mari007 and Gold's Not Enough:

The New SnS

Long John Kickbag

25th March, 2005 at 20:18:15 -

Try this (the actual expression names might be wrong though): Left$("000",Length(Str$(SomeNumber)))+Str$(SomeNumber)

Alternatively I think Tigerwork's String Manipulator object can do it.

Resize! -

Destroyer (CrobaSoft)

26th March, 2005 at 05:55:22 -

i think it should be
left$("000", 3 - len(str$(some number)))+ str$(some number)

Visit or you're a Noob.

DistantJ [FZ Games]

26th March, 2005 at 07:14:59 -

Yeah that sounds about right to me, destroyer.


28th March, 2005 at 00:19:06 -

I think the 'Math's Army Knife' extension can do that, and it comes with an example of it (the digital clock example I believe).

"Computers in the future may perhaps only weigh 1.5 tons."
-Popular Mechanics, forecasting the development of computer technology, 1949

Post Reply



Worth A Click