> On Aug 16, 2020, at 2:31 PM, CARL Philippe (LBP) <
[hidden email]> wrote:
>
> Dear all,
> Is there an easy way apply something similar to the Java DecimalFormat("#0.000") feature within a macro ?
> I thank you very much in advance for your lighting on this.
> My best regards,
> Philippe
The ImageJ 1.53d61 daily build adds a String.format() macro function, which is the same as the String.format() method in Java.
Here is an example:
arr = newArray(23.59004,35.7,3.0,9, 0);
for (i=0; i<arr.length; i++)
print(String.format(“%.3f", arr[i]));
And here is the output:
23.590
35.700
3.000
9.000
0.000
-wayne
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html