double to string in java code example

Example 1: string to double java

public class stringtodouble {
	public static void main(String args) {
    	String string = "1.23";
      	double decimal = Double.parseDouble(string);
    }
}

Example 2: java convert double to string

double total = 44;
String total2 = Double.toString(total);

Example 3: double to string java

double number = -895.25;
String numberAsString = String.valueOf(number);

Example 4: android java double to string

double a = Double.parseDouble(editText.getText().toString());
Double.toString()

Tags:

Java Example