在我的Android應用我發現的其他2個計數器 的百分比與此代碼安卓%的投籃欄填寫太多
double total1 = counter + counter1;
double totaal2 = counter/total1 * 100.0;
percentfield.setText("" + total2);
我的代碼工作的偉大,當百分比領域正顯示出50%,25%等。 但其顯示33.33333333333% 有沒有一種方法,以短了我的百分之領域也只顯示33.3
編輯 我有短下來與下layout.xml
驗證碼android:maxLength="3"