Reputation: 109
I have a TextView which i let display a value i get in my App. This Value is changing sometimes and it is possible that it gets really small. So i have the Problem, that if the value gets too small, my TextView doesnt Show the value i would expect, but the "exponential value" so for example:
The value is 10*10^-3 and my TextView shows 10 instead of 0.01.
Double value = 0.0;
textView.setText(value.toString());
The TextView is working for positive and negative numbers and just has an Limit at the numbers which can be shown.
Any advice what i am doing wrong?
Upvotes: 0
Views: 739
Reputation: 2767
Use Locale
also because if device language change then .(Dot) remain same.
textView.setText(String.format(java.util.Locale.US, "%.2f", value);
Upvotes: 0