-3

I Have String Value. then how to convert in float value and then give it two decimal points?

1 Answers1

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