title: How do I format double input in Java WITHOUT rounding it?
body: <p>I have read this question <a href="https://stackoverflow.com/questions/2808535/round-a-double-to-2-decimal-places">Round a double to 2 decimal places</a> It shows how to round number. What I want is just simple formatting, printing only two decimal places.
  What I have and what I tried:</p>
  
  <pre><code>double res = 24.695999999999998;
  DecimalFormat df = new DecimalFormat("####0.00");
  System.out.println("Value: " + df.format(res)); //prints 24.70 and I want 24.69
  System.out.println("Total: " + String.format( "%.2f", res )); //prints 24.70
  </code></pre>
  
  <p>So when I have 24.695999999999998 I want to format it as 24.69</p>