I Have String Value. then how to convert in float value and then give it two decimal points?
Asked
Active
Viewed 23 times
1 Answers
0
Get String value from Source of Value.
Then Convert it in double
after declare DecimalFormat
Method. and follow bellowed step.
String value = "10.0000000"
double valueInFloat = Double.parseDouble(value);
Declare Method Now.
DecimalFormat decimalPoint = new DecimalFormat("0.00");
textview.setText(decimalPoint.formate(valueInFloat));
Output: is 10.00

luk2302
- 55,258
- 23
- 97
- 137

Nikhil S Marathe
- 599
- 8
- 8