title: How to split a double number by dot into two decimal numbers in Java?
body: <p>Trying to split a double number into two decimal parts by dot. Like  this: 1.9 into 1 and 9; 0.16 into  0 and 16;</p>
  
  <p>Here's what I do, but seems a little redundant, what's the best way to do this?</p>
  
  <p>The origin number will always be like Just 0.x or 1.x or 0.xx or 1.xx and xx > 10 </p>
  
  <pre><code>    double d = 1.9;
      int a, b;
      String dString = Double.toString(d);
      String aString = dString.substring(0, 1);
  
      String bString = dString.substring(2);
      a = Integer.parseInt(aString);
      b = Integer.parseInt(bString);
  </code></pre>
  
  <p>My way of doing this seems using to much String conversion,which I don't think is very efficient. </p>