title: Remove trailing zeros from double
body: <p>I would like to remove all trailing zeros without truncating or rounding the number if it doesn't have any. For example, the number could be something like <code>12.0</code>, in which case, the trailing zero should be removed. But the number could also be something <strong>almost</strong> irrational, like <code>12.9845927346958762...</code> going on an on to the edge of the screen. Is there a way to setup DecimalFormat or some other class to cut of trailing zeros, while keeping the irrationality intact?</p>