title: Manually convert string to double java without using parse double
body: <p>we're told to convert strings to double without using parse double or any math,int, or double function. I'm having a hard time converting the numbers using exponents.</p>
  <pre><code>public class Convert {
  
      public static void main(String args[]) {
          String num = &quot;1223.230&quot;;
          int d = 0, g = 0, c = 0, fnl = 0;
          int exp = (num.indexOf(&quot;.&quot;) - 1);
          while (num.charAt(d) != '.') {
              g = num.charAt(d) - 48;
              int k = 1;
              for (int f = 0; f &lt; exp; f++) {
                  k = (k * 10) * g;
              }
              fnl += k;
              d++;
              exp--;
              System.out.println(fnl);                
          }   
      }
  
  }
  </code></pre>
  <p>These codes only convert the int part of the given string and it prints the wrong answer.</p>