Login  Register

Re: convert string in a number

Posted by Gluender-4 on Aug 10, 2010; 11:31am
URL: http://imagej.273.s1.nabble.com/convert-string-in-a-number-tp3687303p3687304.html

>   Dear;
>
>    I would like to use a metadata from a image for some calculation.
>The problem is that this data appears as a string, in my case "1460".
>    So for make algebraic operation I need to convert it in a number
>"1460"->1460. Is it possible in macro language?
>
>    Thanks a lot,
>--
>Dr Luis Isaac Ramos Garcia

Luis,

please consult the documentation of ImageJ's "Built-in Macro Functions".

There you may find teh following entry:
"parseInt(string)
Converts string to an integer and returns it. Returns NaN if the
string cannot be converted into a integer."

HTH
--

                   Herbie

          ------------------------
          <http://www.gluender.de>