Login  Register

Re: Scientific notation within a numericField of a GenericDialog

Posted by Herbie on Mar 10, 2021; 10:53am
URL: http://imagej.273.s1.nabble.com/Scientific-notation-within-a-numericField-of-a-GenericDialog-tp5024509p5024514.html

Bonjour Philippe,

when using e.g.
         IJ.d2s( yourDecimalNumber, -2 );
you may even append "toLowerCase()" which gives
         IJ.d2s( yourDecimalNumber, -2 ).toLowerCase();
and from my point of view results in improved readability...

Best

Herbie

:::::::::::::::::::::::::::::::::::::::::::::::::
Am 09.03.21 um 21:20 schrieb CARL Philippe (LBP):

> Dear Michael,
> Thanks a lot for your (as always) very sharp answer which is working as described!
> I had lost myself in way more complicated solutions.
> Kindest regards,
> Philippe
>
> ----- Mail original -----
> De: "Michael Schmid" <[hidden email]>
> À: "imagej" <[hidden email]>
> Envoyé: Mardi 9 Mars 2021 20:55:55
> Objet: Re: Scientific notation within a numericField of a GenericDialog
>
> Hi Philippe,
>
> you can specify a negative number for the number of digits, then ImageJ
> uses scientific notation. It is the same as with IJ.d2s (java) or d2s
> (macro).
>
> Macro example:
>
>     Dialog.create("test");
>     Dialog.addNumber("the number", 1.0, -3, 8, "units");
>     Dialog.show();
>
>
> Michael
> ________________________________________________________________
> On 09.03.21 19:59, CARL Philippe (LBP) wrote:
>> Dear all,
>> Is there a way to force the content of a numericField (at least for its defaultValue) within a GenericDialog to be shown with scientific notations.
>> I thank very much in advance for your help on this.
>> My best regards,
>> Philippe
>>
>> Philippe CARL
>> Laboratoire de Bioimagerie et Pathologies
>> UMR 7021 CNRS - Université de Strasbourg
>> Faculté de Pharmacie
>> 74 route du Rhin
>> 67401 ILLKIRCH
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html