casting double to string in java code example
Example 1: double to string java
double number = -895.25;
String numberAsString = String.valueOf(number);
Example 2: java double to string with 2 decimals
double d = 5.921763;
DecimalFormat df = new DecimalFormat("#.00");
String string = df.format(d);
// string = "5.92"