title: How to format a float so that the digit before the separator is not shown, if it is 0
body: <p>I currently something like this:</p>
  <pre><code>float someFloat = -0.42f;
  String.format(&quot;%.2f&quot;, someFloat);
  </code></pre>
  <p>This will print as:</p>
  <pre><code>-0.42
  </code></pre>
  <p>I would like to save space, since this is output to a GUI with limited horizontal space. So instead I would like it to print:</p>
  <pre><code>-.42
  </code></pre>
  <p>and similarly for a positive value, e.g.:</p>
  <pre><code>.52
  </code></pre>
  <p>For values a with |a|&gt;1, it should still print the digit before the separator, e.g.:</p>
  <pre><code>42.42
  </code></pre>
  <p>How do I achieve this?</p>