Android - how to set a text with two decimal places in a button
<p>I need to set a button text with two decimal places. The value source is double that come like 1.0, 5.0, 10.0 or 100.0 and the string format below convert it to have two decimal places, So it is working. </p>

<pre><code>            b = new Button(context);
            String stringdouble = String.format("%.2f", 1.0);

            b.setText(stringdouble);
</code></pre>

<p>However, even on debug mode the variable "stringdouble" be "1.00" or "5.00" or "10.00" or "100.00",
on the button they are displayed like "1.0", "5.0", "10.", "100".</p>

<p>Does anybody know why it happens?? </p>

<p>thank you</p>
