| | |
converting double to string
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2005
Posts: 216
Reputation:
Solved Threads: 8
•
•
•
•
Originally Posted by Dark_Omen
Is there a way to convert a double to string. I tried to do it like this x.toString() and it didnt work as well as implicitly converting it.
There are several ways to convert a double to a String...
Java Syntax (Toggle Plain Text)
double value = 1.0; // This is ok. String firstDouble = value + ""; // This is better. String secondDouble = Double.toString(value);
There are other ways, but these two ways will work fine.
Regards,
Nate
![]() |
Similar Threads
- Float/Double to String conversion (C)
- string to long and string to double in c (C)
- Problem converting to a double (C)
- warning C4244: 'argument' : conversion from 'double' to 'char', possible loss of data (C)
- cannot convert from 'double' to 'float [6][3]' (C)
- decimal counting of a double... howto? (Java)
Other Threads in the Java Forum
- Previous Thread: Using a Comparable Class with Treeset, creating counter in comparable
- Next Thread: opinions on O(n log n) sorts
Views: 14112 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application arguments array arrays automation bidirectional binary birt bluetooth calculator chat class classes client code columns component database designadrawingapplicationusingjavajslider detection draw eclipse editor error errors event exception expand file fractal game givemetehcodez graphics gui guidancer helpwithhomework html ide image inetaddress input integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jme jmf jni jpanel julia linux list loop map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie number object oracle os plazmic print problem program programming project recursion scanner screen server set signing size smart sms smsspam socket sort sql string subclass support swing test threads time transfer tree windows





