Printing the correct amount of decimal places? (printf) - JAVA
<p>I'm trying to give back to the community a bit more...</p>

<p>Let's say x, my double variable, sometimes has different amounts of decimal places. (Ex. 1.2, 1.23, 1.234) But I only want to printf the minimum amount of decimal places that the variable has, without all those 0s at the end. How do I do that?</p>