androidkeep
Lurker
How do you format a textview?:
Let say I have 4 float variables
x input from user
y input from user
z input from user
a output from program
a = ((x *y) / z);
a = a * 1000;
this works but is not formatted:
TextView.setText(String,valueOf(a));
so if x = 1, y = 2, and z = 12;
a will = 166.666667
I want to be able to format 'a';
I want to be able to format 'TextView.setText(String,valueOf(a)); so 'a' will be displayed as 166.66 or 166.67 as the case may be in a TextView.
or even 166.667 .
Let say I have 4 float variables
x input from user
y input from user
z input from user
a output from program
a = ((x *y) / z);
a = a * 1000;
this works but is not formatted:
TextView.setText(String,valueOf(a));
so if x = 1, y = 2, and z = 12;
a will = 166.666667
I want to be able to format 'a';
I want to be able to format 'TextView.setText(String,valueOf(a)); so 'a' will be displayed as 166.66 or 166.67 as the case may be in a TextView.
or even 166.667 .