
-----------------------------------
Token
Thu May 04, 2006 9:53 am

Converting a string to a double
-----------------------------------
I am trying to make a calculator program with GUI and stuff and i have all my keys working but all i need is to do the calculations part. when you press a number or the decimal key it adds the number or decimal to the end of a String, like a calculator does. but in order to do the calculation I'll need to convert this String to a Double, and i cant do that with 
Double.parseDouble(string)
because i'm using RTP. please help

thanks

-Jordan

-----------------------------------
HellblazerX
Thu May 04, 2006 10:05 am


-----------------------------------
I used the same command in RTP, and it worked perfectly fine for me.  Perhaps you forgot to assign that value to something, like this:

double = Double.parseDouble (string);

What version of RTP are you using?

-----------------------------------
Token
Thu May 04, 2006 7:32 pm


-----------------------------------
Version 1.0.6

Yah, Assigned it to a variable, but it didnt work, i couldent find it in the double class in my help file so i'm guessing its not with my version.

so no one can think of any other commands?

-----------------------------------
wtd
Thu May 04, 2006 7:48 pm


-----------------------------------
Don't use RTP.  Download the JDK from Sun and there won't be any question about your environment being borked.

-----------------------------------
codemage
Fri May 05, 2006 8:54 am


-----------------------------------
If it's being graded in school, it'll be by a teacher with the same crummy version of RTP.

It's bizarre that your version is so old though.  Current ver is 1.7 - and it's not exactly new.

-----------------------------------
Token
Sat May 06, 2006 11:08 pm


-----------------------------------
Double.valueOf (double d).doubleValue ()

tada! all thanks to http://javaboutique.internet.com I looked at a copy of a calculator program they made and found that little tidbit of greatness. Thanks for your help, and heres my (semi finnished) applet.
