code: private String rightAlignedZero(String s, int len)
      {
          if (len == s.length()) return s;
  
          StringBuffer sb = new StringBuffer(s);
  
          while (sb.length() < len)
          {
              sb.insert(0, '0');
          }
  
          return sb.toString();
      }
docs: Method to generate a string with a particular width.  Alignment is done using zeroes if it does not meet the width requirements.
  @param s The string to write
  @param len The minimum length it should be, and to align with zeroes if length is smaller.
  @return A string properly aligned/correct width.