I would like to convert an integer into a string with leading zeros in ImageJ / Fiji macro editor using String.format()
function. With this code:
s = String.format("%04d", 13);
print(s);
I get the following error:
Unrecognized String function in line 2
s = String . <format> ("%04d" , 13);
Any ideas?
After the documentation https://imagej.nih.gov/ij/developer/macro/functions.html#S this should work:
String.format(format, number) - Returns a formatted string using the specified format and number.
Version: ImageJ 1.53c with Java 1.8.0_172 (64-bit)