Left pad a number with leading zeroes
Thanks to mauricekremer.dyndns.org for the concept and code. Below is my take on the function.
public static String PadZeros(Integer Num, Integer Len) {
String s = String.valueOf(Num);
while (s.length() < Len) s = '0' + s;
return s;
}
s.leftPad(Len).replace(‘ ‘,’0’); should do the same
This is great. Simpler and doesn’t require a loop.