convert string in a number

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

convert string in a number

Luis Isaac Ramos Garcia
   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
Departamento de Oncologia
Clinica Universidad de Navarra
Facultad de Medicina,Universidad de Navarra
Av. Pio XII nÂș36, 31008 Pamplona, Spain
Fax: +34 948255500
TEL: +34 948255400 (Ext. 4924)
E-mail: [hidden email]
Web Page: http://www.cun.es
Reply | Threaded
Open this post in threaded view
|

Re: convert string in a number

Gluender-4
>   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>