Converting a double to a string?

I need to change a double to a string..... how is this done.i have made some sort of calculator, default display is 0.0 but when i push buttons i.e. 1 it will appear as 0.01, if no text is in the box it will break the program. cheers
[254 byte] By [junglecat1a] at [2007-11-26 22:25:02]
# 1
Ahem, where is the relevant code? What breaks? Where is the stack trace? My bloody crystal ball sucks today.
PhHeina at 2007-7-10 11:25:39 > top of Java-index,Java Essentials,Java Programming...
# 2
String.valueOf(double d);orDouble.toString(double d);neither is better than the other
georgemca at 2007-7-10 11:25:39 > top of Java-index,Java Essentials,Java Programming...
# 3

> I need to change a double to a string..... how is

> this done.

double d = 2.0;

String s = String.valueOf(d);

> i have made some sort of calculator, default display

> is 0.0 but when i push buttons i.e. 1 it will appear

> as 0.01, if no text is in the box it will break the

> program.

>

> cheers

Don't quite understand this part.

prometheuzza at 2007-7-10 11:25:39 > top of Java-index,Java Essentials,Java Programming...