title: Show decimal of a double only when needed
body: <p>I got this problem with double (decimals).<br>
  When a double = 1.234567 Then I use <code>String.format("%.3f", myString);</code><br>
  So the result is 1.234  </p>
  
  <p>But when my double is 10<br>
  The result will be 10,000<br>
  I want this to be 10</p>
  
  <p>Is their a way to say that he only needs to show the decimals when it is "usefull"?</p>
  
  <p>I saw some posts about this, but that was php or c#, couldn't find something for android/java about this (maybe I don't look good).</p>
  
  <p>Hope you guys can help me out with this.</p>
  
  <p>Edit, for now I use something like this: <code>myString.replace(",000", "");</code><br>
  But I think their is a more "friendly" code for this.</p>