code: public String fmtpl(String d, int pad) {
  		int length = d.length();
  		int extra = pad - length;
  		if (extra < 0) {
  			extra = 0;
  		}
  		String v = d;
  		for (int i = 0; i < extra; i++) {
  			v = " " + v;
  		}
  		return v;
  	}
docs: Pad left a string with spaces
  
  @param d
  @param pad
  @return