title: Java how to extract last digit of a integer then display to that number of decimal?
body: <p>for example if user enters <code>133.66666</code>
  it will return <code>133.666</code>.</p>
  
  <pre><code>155.88888888888
  =155.88888
  
  821.8765432
  =821.8
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>Scanner keys = new Scanner( System.in );
  double x = (int) keys.nextDouble();
  double lastdigit=x%10;
  </code></pre>
  
  <p>This is how find the last digit
  but how do I use the digit number to display the amount of decimal?</p>
  
  <p>Sorry I wasn't clear enough
  User can enter any number they want (assume they are all positive)
  then I use the last digit of integer number X to display X amount of decimal</p>