converting String to number?
Posted by Adam Cliffe on
URL: http://imagej.273.s1.nabble.com/converting-String-to-number-tp3690692.html
Hi,
I'm trying to extract some information from an XML file. I can get the
part I want as a string
but I'd like to convert it to a number so I can use it later.
Here's an example
XMLtext="Variant=0.03140118509446um";
step=substring(XMLtext,8,24);
output=parseFloat(step);
print(output,"should be",step);
storage=newArray(1);
storage[0]= output;
So using parseFloat I end up with 0.314
does anyone know of a way to increase the number of decimal places?
(or a better way of doing this?)
thanks
Adam
Dr Adam Cliffe
Research Scientist, Rorth Lab
Institute of Molecular and Cell Biology
61 Biopolis Drive
Proteos
Singapore 138673
tel: +65 6586 9731
Note: This message may contain confidential information. If this Email/Fax has been sent to you by mistake, please notify the sender and delete it immediately. Thank you.