I am writing a small code to output a double variable using textview. However I am not able to control the number of decimals. Is there any way to control the number of decimals in textview.
code:
TextView temp;
temp = (TextView)findViewById(R.id.textView3);
double T = (3*(Math.pow(4,-1.2)));
temp.setText("Temperature ="+String.valueOf(T) + " deg C");
I wanted to print only four decimals in outputted textview.