In my response i am getting the value as 80.00000
DecimalFormat df = new DecimalFormat("##.##");
TextField.setText(df.format(Double.parseDouble(custom.getValue())));
My problem is i am getting 80.000, i am doing a parseDouble which will return a primitive double type and i am doing a format to this double to 2 decimals
.
Why am i getting 80
instead of 80.00
?
I changed my way and tried with this.
TextField.setText(String.format("%2f",Double.parseDouble(custom.getValue())));
Now i am geting 80.000000
instead of 80.00