title: Change double decimal spaces depending on int value
body: <p>i want to change the decimal spaces of an double, depending on the int value that i use. I Figured out, that i can change the decimal spaces &quot;manually&quot; by changing to 10 or 1000 and so on, but i dont know how to accomplish this, other than changing said values in the code.</p>
  <p>My second quest is  how to round double values for example 19.657 up to 19.66, or 19.652 down to 19.65 .</p>
  <p>Note :</p>
  <ul>
  <li><p>WITHOUT the use of imports and only the default package</p>
  </li>
  <li><p>I use Java with Eclipse as my IDE</p>
  </li>
  </ul>
  <p>Thank you in advance for your effort  :)</p>
  <pre><code>    double x = 19.657821456;
      int y = 3;  
  
          x = x*10; 
          x = (double)((int) x);
          x = x /10;
                   
              
  </code></pre>