title: Number BreakingDown
body: <p>So I was asked to do a code that returns the broken down version of the given number. The output should be like this:</p>
  
  <pre><code>Number to break down: 123045011
  
  100000000
  
  20000000
  
  3000000
  
  0
  
  40000
  
  5000
  
  0
  
  10
  
  1
  </code></pre>
  
  <p>But what my program does is this:</p>
  
  <pre><code>Number to break down: 123045011
  100000001
  100000002
  100000003
  100000000
  100000004
  100000005
  100000000
  100000001
  100000001
  </code></pre>
  
  <p>This is my code. </p>
  
  <pre><code>import java.util.Scanner;
  
  public class NumberBreakdown {
      public static String brokeDownNumber(int num) {
          String numberBrokenDown = "";
          int numLength = Integer.toString(num).length();
          String numAsString = Integer.toString(num);
  
          for(int i = 0; i &lt; numLength; i++) {
              // convert Integer to string by using Integer.toString(varToConvert);
              // convert char to String by using Character.toString(varToConvert)
  
              int currentNum = Integer.parseInt(Character.toString(numAsString.charAt(i)));
              currentNum += Math.pow(10,numLength  - 1);
              numberBrokenDown += Integer.toString(currentNum) + "\n";
  
          }
          return numberBrokenDown;
      }
      public static void main(String[] args) {
          // no need to change this 
          Scanner reader = new Scanner(System.in);
          System.out.print("Number to break down: ");
          int number = Integer.parseInt(reader.nextLine());
          System.out.println(brokeDownNumber(number));
  
      }
  }
  </code></pre>
  
  <p>What should I change/do?</p>