double value1 = 1000
double value2 = 2563.59
System.out.println("value1 ="+String.format("%.2f",value1));
System.out.println("value2 ="String.format("%.2f",value2));
Output
value1 = 1000.00
value2 = 2563.60
This returns 1000.00
and 2563.60
but the type of output changes to string.
I want 1000.00
and 2563.60
as the output without changing the datatype.
Can anyone help me?
The dtatype must be double itself