Generate 001,002... name increments
Posted by lechristophe on Aug 30, 2007; 9:57am
URL: http://imagej.273.s1.nabble.com/Generate-001-002-name-increments-tp3698075.html
Hi folks,
I'm programming a macro function that checks if a given file exists and
if so, automatically iterates the name to avoid overwriting previous
macro outputs.
Is there a simple way to generate a name suffix with beginning zeros
like 01,02,03...10,11,12...99 ? I could write a function to transform
index number into zero-containing suffixes, but I'm wondering if iy
already exists in the macro language or in Java.
If it does'nt exist, maybe this function could be added to the decimal
to string d2s() function by adding a second argumnt that specifies the
number of figures before the coma (the other decimal argument specifying
the number of decimals after the coma).
something like
a=3
d2s(a,2,0)="03"
d2s(a,3,4)="003.0000"
or a function "integer to string" that would incorporate such a feature...
Christophe Leterrier