How to display or print fixed number of decimal points of float data in textView of Android App?

preview_player
Показать описание
In this video it shows how to limit the number of decimal points of a float or decimal while printing it on a textView widget of Android App. It basically uses below line of code to limit the decimal places.

Complete source code and other details/ steps of this video are posted in the below link:

However, the main Java code is copied below also for reference:

public class MainActivity extends AppCompatActivity {
private Float aFloatNumber = .621478f;
private TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {

return insets;
});
}

public void buttonFixDecimalPoints(View view){
}
}

--
Рекомендации по теме
visit shbcf.ru