title: How to prevent Java from auto rounding up
body: <p>I have a method which returns a double</p>
  
  <pre><code>public double getOdds() {
      return odds;
  }
  </code></pre>
  
  <p>This works completly fine. However, the problem is when the data is displayed, it automatically rounds the inserted value up. I want to prevant that, and get a value with 2 decimals. </p>
  
  <p>Here are my JSP where I call the method. The ArrayList "bets" consist of all values entered by the user. But, as explained above, when the user enters 2.75 then it will return 3.0</p>
  
  <pre><code>ArrayList &lt;bets&gt; bets = betsDAO.getBets(x, y);
  
  for (bets bet : bets) {
  
      &lt;td&gt;&lt;%=bet.getOdds()%&gt;&lt;/td&gt;
  }
  </code></pre>
  
  <p>I'm still new to Java, and have tried looking for solutions, but unfortunatly I have not been able to solve the issue. </p>